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

ParserError's should not return 500 HTTP status codes #812

Closed
ml-evs opened this issue May 24, 2021 · 0 comments · Fixed by #813
Closed

ParserError's should not return 500 HTTP status codes #812

ml-evs opened this issue May 24, 2021 · 0 comments · Fixed by #813
Assignees
Labels
bug Something isn't working parser Related to the Lark parser priority/high Issue or PR with a consensus of high priority server Issues pertaining to the example server implementation

Comments

@ml-evs
Copy link
Member

ml-evs commented May 24, 2021

When the Lark parser is unable to parse a filter in an unhandled way, we throw a ParserError, which inherits directly from Exception and thus the server treats it as a 500 Server Error.

Instead this should raise a 400 Bad Request and return the Lark error message.

This is something that has been biting OPTIMADE implementations that use k8s, as 500 is treated as "down endpoint" status code (cc @shyamd).

@ml-evs ml-evs added bug Something isn't working priority/high Issue or PR with a consensus of high priority server Issues pertaining to the example server implementation labels May 24, 2021
@ml-evs ml-evs self-assigned this May 24, 2021
@ml-evs ml-evs added the parser Related to the Lark parser label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Related to the Lark parser priority/high Issue or PR with a consensus of high priority server Issues pertaining to the example server implementation
Projects
None yet
1 participant