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

More descriptive errors #137

Open
alexkreidler opened this issue Aug 4, 2023 · 2 comments
Open

More descriptive errors #137

alexkreidler opened this issue Aug 4, 2023 · 2 comments

Comments

@alexkreidler
Copy link

Currently, a failed input validation will result in RequestValidationError: Schema validation error, which doesn't provide any details on which paramater/body field are missing, the wrong type, or otherwise caused the error. This might need passing an option to the underlying validation library.

@VolodymyrMachekhin
Copy link

+1 to it, @alexkreidler have you found a workaround to it?

@supertong
Copy link
Collaborator

Hey, I believe that's due to how koa handles the error. We have expose all the details in the error object here, however, since we are using ctx.throw to throw the error, koajs by default would only return the message of the error back to the client. In order to return all the details back to the client, the best solution for now is to use a custom error handler.

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

No branches or pull requests

3 participants