You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current @plone/client code validates the status to be between a 200 and 300 status code. As shown in the axios docs for configuring requests, this is the default behaviour. However, this results in 'invalid' (i.e. all non 2XX HTTP status codes) reponses raising an AxiosError (e.g. AxiosError: Request failed with status code 404). Axios expects these non-valid status codes to be handled by a Promise catch handler, as shown by the Axios Handling Errors documentation. We are not handling these errors, as shown in the following code:
Make a request that will give a non-200 response (e.g. a getContentQuery to a page that doesn't exist will produce a 404).
See the exception
Expected behavior
EITHER:
The exception is handled by the plone client a way of correctly handling the differing status codes is available for the developer using `@plone/client
OR:
There is documentation around how to correctly handle these exceptions by an integrator.
The text was updated successfully, but these errors were encountered:
Describe the bug
The current @plone/client code validates the status to be between a 200 and 300 status code. As shown in the axios docs for configuring requests, this is the default behaviour. However, this results in 'invalid' (i.e. all non 2XX HTTP status codes) reponses raising an
AxiosError
(e.g.AxiosError: Request failed with status code 404
). Axios expects these non-valid status codes to be handled by a Promise catch handler, as shown by the Axios Handling Errors documentation. We are not handling these errors, as shown in the following code:volto/packages/client/src/API.ts
Line 104 in fdcc874
To Reproduce
Steps to reproduce the behavior:
getContentQuery
to a page that doesn't exist will produce a 404).Expected behavior
EITHER:
OR:
The text was updated successfully, but these errors were encountered: