tomer-yechiel / pino-sentry-transport

MIT License
24 stars 8 forks source link

Undefined error being sent to Sentry due to pino-abstract-transpot breaking change #222

Closed dmuharemagic closed 2 months ago

dmuharemagic commented 2 months ago

Describe the bug It seems that the latest release to pino-abstract-transport has introduced a breaking change in a minor version (probably correlated to v1.2.0).

Serialized error is now not located in a nested err object, rather the root obj - https://github.com/tomer-yechiel/pino-sentry-transport/blob/main/src/index.ts#L97.

This results into an undefined error being sent to Sentry.

To Reproduce Steps to reproduce the behavior:

  1. Install the dependency
  2. Integrate with Sentry
  3. Observe undefined being sent to Sentry, instead of the actual error

Expected behavior The actual error contents should be extracted from the Pino logs and sent to Sentry.

Screenshots

image

This depicts the debug output of the obj, located here.

Desktop (please complete the following information):

tomer-yechiel commented 2 months ago

Hi @dmuharemagic, I can't reproduce. can you please provide how do you log the error with Pino? the proper way to log error with Pino is to pass the error object as the first parameter to the logger for example

logger.error(e)
dmuharemagic commented 2 months ago

Seems to be a misconfiguration on my side due to changing the expected structure of the error object. Sorry for the inconvenience.