Does exceding the cache object limit throw an error?

I have a 100 object cache limit. I will probably hit that limit and want to know if an error will be thrown. If an error is thrown, should I put a try-catch block around the Put Data into Cache block to handle the error?

If an error is not thrown, does it just act like the data was added but isn’t?

Thanks,
Tim

Hi @Tim_Jones,

When you hit limit for cache you will receive next response from the server

{
    "code": 11005,
    "message": "You have reached the plan's limit. To increase the limit you need to purchase the '100 Cache Objects' function pack from the Marketplace or upgrade to a plan with bigger limits",
    "errorData": {}
}

HTTP code of response will be 403.

Regards, Andriy

Thanks for the details. A few follow on questions:

  1. Am I correct that the only place I would see the next response from the server is in the log file?
  2. If that is correct, what log level do I need to be running to have that written to the file?
  3. Will this be caught in a try/catch block?

Thank you,
Tim

Hi Tim,

let me answer your questions.

  1. Am I correct that the only place I would see the next response from the server is in the log file?

No, this response will be in your code. To catch this error you should use the try/catch block.

  1. If that is correct, what log level do I need to be running to have that written to the file?

See #1. :slight_smile:
If you want to log the error, you can use the Logging API.

  1. Will this be caught in a try/catch block?

Yes.

Regards,
Stanislaw

Good to know. I will put all my Put Data into Cache blocks in a try/catch block.

Thanks,
Tim