Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle additional bodyParser errors #788

Closed
matthew-white opened this issue Jan 24, 2022 · 0 comments · Fixed by getodk/central-backend#1333
Closed

Handle additional bodyParser errors #788

matthew-white opened this issue Jan 24, 2022 · 0 comments · Fixed by getodk/central-backend#1333
Assignees
Labels
backend Requires a change to the API server bug nicer error More understandable error messages

Comments

@matthew-white
Copy link
Member

matthew-white commented Jan 24, 2022

If the size of a JSON request body exceeds the bodyParser limit in Backend, then bodyParser will throw an error with a status property of 413. However, Backend will then return a 500 error, not a 413. The error has the message, "Completely unhandled exception: request entity too large". I think it would be ideal for Backend to return a 413 Problem in this case. (See getodk/central-backend#446 for some more details about this error.)

We already handle bodyParser errors of type entity.parse.failed. Given that, I think we could do something similar for errors of type entity.too.large. It would probably be useful to also take a look at the list of bodyParser errors to see if there are others to account for. (Is there a generic way to handle any bodyParser error?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires a change to the API server bug nicer error More understandable error messages
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

2 participants