You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Catch(Error)exportclassErrorExceptionFilterextendsBaseExceptionFilter{catch(error: Error,host: ArgumentsHost){console.log(error)// error is a FastifyError, not HttpException}}
Expected behavior
My custom ExceptionFilter should see an HttpException exception instead of a FastifyError when the content-type is invalid.
Other
No response
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
No response
NestJS version
11.1.0
Describe the regression
FastifyError with code
FST_ERR_CTP_INVALID_MEDIA_TYPE
is not being rethrown as an nestjs HttpException.I have an existing guard that validates content-type to always be
application/json
and raise aUnsupportedMediaTypeException
if not.But now in nestjs v11, if I make a request with an invalid content-type (say
foo
), my guard doesnt run and instead I seein my custom ExceptionFilter
Minimum reproduction code
https://github.com/yawhide/nestjs-issue-15022
Input code
Expected behavior
My custom ExceptionFilter should see an
HttpException
exception instead of aFastifyError
when the content-type is invalid.Other
No response
The text was updated successfully, but these errors were encountered: