-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Feature Request
Is your feature request related to a problem? Please describe.
The issue is that I am not able to execute two exception filters as the filter themselves are actually single pointcut for the chain.
Describe the solution you'd like
The first option would be to have Filter with a similar syntax to Interceptor such that developers can decide if the Filter is a pointcut or not.
A second option would be to apply a Pipe or an Interceptor at different levels, such as to catch errors from Guard.
What is the motivation/use case for changing the behavior?
A request comes into the following API
req -> TraceMiddleware -> AuthGuard -> LoggingInterceptor -> GQLResolver w/ TransformExceptionFilter(HttpException)Each step can potentially throw an Exception, not necessarely an HttpException.
The Exception transformation is done in a Filter in order to be able to catch errors coming from any step.
As a new feature, I would like to have a logger to log every exception that is happening, potentially with the ExecutionContext from which is thrown, without having to change my existing filter to comply with SRP and prevent mixing up logging with transformation.
Possible scenarios:
- A
Middlewarewould not have theExecutionContext. - An
ExceptionLoggingInterceptorwould not be called to log if the failure point isTraceMiddlewareorAuthGuard. - A second
Filterwould not be run together with theTransformExceptionFilter.