Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Have friendlier 400 errors #145

Open
rjw57 opened this issue Mar 16, 2018 · 0 comments
Open

Have friendlier 400 errors #145

rjw57 opened this issue Mar 16, 2018 · 0 comments

Comments

@rjw57
Copy link
Member

rjw57 commented Mar 16, 2018

Have friendlier error messages:

For example:
404 -> We can't find that page.
401 -> You aren't allowed to do this.
500 -> A 500 Error Occurs when something blows up with our code. You viewing this does not fix the code. You're likely pissed off at the moment. Take solace. Top men are now aware.

If the backend raises a HTTP 400 error because of a malformed POST, we raise a snackbar with "APIError 400" or similar but the backend actually sets useful information in the payload (e.g. "department is required"). One can trigger this if, e.g., one forcibly saveDraft()-s a new entry with a blank department as a user with two institutions. (Which was, in fact, how this bug was found.)

We shouldn't get HTTP 400 (or any other error) in normal use but, if we do, including something from the payload in the snackbar would be helpful for debugging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant