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
How do we want to handle errors from the API, e.g. signal through HTTP codes (e.g. 403), an empty answer or always do json with a status that is always filled in?
The text was updated successfully, but these errors were encountered:
When working on the frontend, I think it's really helpful to get proper status codes for different types of errors. When I'm still working on the code, I also appreciate if there is some error message sent in the json response that indicates what went wrong. That's more for my own purpose though. I don't show these API-messages to the user but rather have a separate message to the user in the frontend-code. That can be due to language reasons (API sends message in English, website is in Swedish) or because I want to phrase it in a nicer/more helpful way.
Right now, I think there's a mix; some endpoints return errors akin to jsonapi, some set the return code indicating error on error or return value and some return an empty/null JSON object on error (but a 200). There should definitely be sensible return codes, no matter how we pass them.
How do we want to handle errors from the API, e.g. signal through HTTP codes (e.g. 403), an empty answer or always do json with a status that is always filled in?
The text was updated successfully, but these errors were encountered: