-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
BadRequestException 400 getting returned to client as a 500 error #5241
Comments
Please provide a minimum reproduction. |
Shared libraries should list |
I did what you said, but it not worked. |
@v1d3rm3 without a reproduction I can't tell you what's wrong. What Kamil said it's the correct approach. If you're working with this locally, you'll need to move the built library to the |
@jmcdo29, i'm using Lerna. I'll try to create a reproduction. Thanks. |
@v1d3rm3 your code is invalid. |
Bug Report
Current behavior
I have an endpoint that is returning 500 when it should be returning 400. The controller associated with this endpoint is throwing a BadRequestException, but when it bubbles up to the global Nest error handling mechanism it is not being recognized as an instance or subclass of HttpException. Therefore, Nest is returning a default of 500 to the client.
Expected behavior
I would expect Nest to recognize the BadRequestException as a valid instance of HttpException and return 400 to the client, rather than the fallback error of 500.
Environment
The text was updated successfully, but these errors were encountered: