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

Inconsistent errors when model is not found #282

Open
ttoino opened this issue Dec 11, 2022 · 0 comments · May be fixed by #309
Open

Inconsistent errors when model is not found #282

ttoino opened this issue Dec 11, 2022 · 0 comments · May be fixed by #309
Labels
bug Something isn't working P1 Medium Priority

Comments

@ttoino
Copy link
Member

ttoino commented Dec 11, 2022

As discussed in this comment and this other comment, when a model is not found a 404 Not Found error should be returned, however, this only happens for a few routes as we're currently using validators to check if a model exists, which return a 422 Unprocessable Entity instead.

Additionally, when a route does return a 404 this is implemented in the function body directly, leading to duplicated code. This could be abstracted out into a middleware.

@ttoino ttoino added bug Something isn't working P1 Medium Priority labels Dec 11, 2022
@ttoino ttoino linked a pull request Feb 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Medium Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant