nestjs-pino icon indicating copy to clipboard operation
nestjs-pino copied to clipboard

[FEATURE REQUEST] Correct stack trace of a guard error in request errored pino-http's log

Open artursudnik opened this issue 1 year ago • 14 comments

The problem I am facing is similar to those described in this feature request. Despite after using LoggerErrorInterceptor I am getting the correct stack trace of errors thrown from controllers or services when an error is thrown from a guard, it behaves like LoggerErrorInterceptor was not used.

Describe the solution you'd like I am not sure if it is a bug or if additional functionality to be added. Probably this problem is caused by Interceptor not being called at all when application flow is broken on a guard level.

artursudnik avatar Aug 31 '22 21:08 artursudnik

can you provide minimal example repo with logs?

iamolegga avatar Sep 01 '22 07:09 iamolegga

@iamolegga sure, I'll isolate this

artursudnik avatar Sep 01 '22 07:09 artursudnik

@iamolegga I apologize for the delay. Here is this problem reproduced: https://github.com/artursudnik/nestjs-pino-issue.

artursudnik avatar Sep 05 '22 22:09 artursudnik

I can confirm this happens to me either. Have you came up with a workaround to it?

mattvgm avatar Oct 20 '22 21:10 mattvgm

No, unfortunately, I have not.

artursudnik avatar Oct 21 '22 00:10 artursudnik

Does it work properly with the original built-in logger?

iamolegga avatar Oct 21 '22 10:10 iamolegga

@iamolegga I need to double-check this. I guess yes though.

artursudnik avatar Oct 21 '22 12:10 artursudnik