Need the list of Error code for prismic API

To handle error codes in our web application, especially when the Prismic API was down recently and it was affecting our service, we need to implement cache control mechanisms for such situations.

Hi @headout,

I'll look into this and get back to you.

Sam

Hi @headout,

I asked our infrastructure team, and they gave me the following list of status codes:

200, 302, 400, 401, 403, 404, 410, 422, 500, 502

We don't have this documented anywhere. However, in @prismicio/client you can see the error messages for the most common status codes:

We're going to work on getting full documentation in our technical reference. Thanks for raising this!

Sam

Hey @samlittlefair , thanks for the reply. Is there any way we can test this error code, similar like a test environment. The use case is that we we will be handling the prismic 5XX with above error code 500 and 502,and we want to test this scenario.

Hi @headout,

That's an interesting question! In short, no. We don't have any way to test internal server errors. I'll keep that in mind as we work on our error handling, though.

Sam