-
-
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
Global interceptor's tap function is not executed if exception has been thrown #1337
Comments
|
@marcus-sa Is there no operator which would execute a function regardless if the "middleware" throws or not? |
|
Apparently Happy Birthday @kamilmysliwiec |
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
I created a global interceptor (literally copy pasted from the interceptor docs) and applied it as global interceptor to my NestJS app:
If an exception is thrown on a called route the "After..." logline will never be printed:
Expected behavior
I expected it to always print before and after.
What is the motivation / use case for changing the behavior?
I want to create prometheus metrics (#967 ) for all routes (e. g. HTTP response duration grouped by HTTP status code) and therefore I always need it to execute a function afterwards.
Environment
The text was updated successfully, but these errors were encountered: