Does anyone have a good overview on what errors the Prismic.client from @prismicio/client can return in different scenarios such as network outage, server side issues, document issues? I would like to write an error handler to cover those for the different scenarios.
Thanks for reaching out to us.
I have asked my dedicated team about different error responses from the Prismic client kit. I'll come back to you as I hear back from them.
With @prismicio/client@5 (or 4), errors throw are generic errors, and the message can help you to write error handlers.
With @prismicio/client@6 (beta), here are the error classes have thrown by the package: prismic-client/index.ts at v6 · prismicio/prismic-client · GitHub, you can use them to identify more precisely what happened.
I hope this answers your question.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
The link that was provided in the solution for v6 is broken: the correct link is prismic-client/index.ts at v6 · prismicio/prismic-client · GitHub
The link points to various Error classes that are returned in the response. I havn't made use of them, but am looking solely at the status parameter of the response.