Swagger docs for Error Responses
Hello, I'm wondering if there's documentation for the different sorts of error responses, kind of like this from the Stripe docs: https://stripe.com/docs/api/errors
I'm building out error handling and if I receive one from the Cloudinary server I want to know what to display on the client-side.
Eg. a timeout error might lead us to display a retry message while a file that's too large will prompt us to ask for a different file.
Thanks
-
Hi James,
We don't currently have a strict or format set of possible error responses for different operations, though we generally use standard HTTP status codes to indicate the high-level reason of the problem as many other services do (e.g. 400 - problem with the request, 404 - not found, etc).
There are some more specific examples in our Admin API documentation here: https://cloudinary.com/documentation/admin_api#error_handlingAnd in our provisioning API documentation here: https://cloudinary.com/documentation/provisioning_api#error_handling
In addition, when making API calls that fail, the response will include an error text, and when accessing an asset's delivery URL that fails, we return an error text in the x-cld-error HTTP header of the response, which can be used to log and display the reason that the asset didn't loadAlso, some of our client SDKs wrap common errors in Exception classes based on the type of error, so you can use the code for those SDKs as further examples of what some of the more common errors are that you may encounter
If you encounter any error where the text isn't clear about what happened, or it's not clear how to resolve it, you can always open a request for our support team via this site ("Submit a request" on the top of the support homepage) and we'll be happy to assist
Thanks,
Stephen
Post is closed for comments.
Comments
1 comment