-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[Exception filter] Use default exception handler on condition #860
Comments
@kamilmysliwiec I have a question that I think is related to this (if not, please tell me and I'll post a separate issue). TL;DR: I wanted to use exception filters to just map some internal exceptions to external user-friently Example: a few of my services use TypeORM's @Catch(EntityNotFoundError)
export class EntityNotFoundFilter implements ExceptionFilter {
catch(exception: EntityNotFoundError, _host: ArgumentsHost) {
throw new NotFoundException(exception.message);
}
} Current behavior: The new, mapped error is not handled by the "built-in" exception handler, which transforms
Expected behavior: the thrown Question: is there some recommended way to achieve this, without manually constructing the response in my custom exception handler (or some other place)? |
resolved by #908 |
5.2.0 is here! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm submitting a...
Current behavior
There is no way to pass the execution to the default exception handler on some condition when using custom exception filter.
Expected behavior
E.g. when you return
false
fromcatch
method of your custom exception filter, the default exception handler should proceed the execution as if there is no custom exception filter.What is the motivation / use case for changing the behavior?
I'm creating single page application and want to return an
index.html
file onNotFoundException
, but only if the requested path doesn't start with/api
, in this case I would like to handle the exception the default way.The text was updated successfully, but these errors were encountered: