keymetrics / pm2-io-apm

PM2.io APM for Node.JS
Apache License 2.0
147 stars 39 forks source link

Fix: Make sure we retrieve a good unhandledRejection message #11

Closed Unitech closed 6 years ago

Unitech commented 6 years ago

http://www.petecorey.com/blog/2018/03/12/the-headache-and-heartache-of-unhandled-rejections/

Currently it's like that: https://github.com/keymetrics/pmx/blob/master/lib/notify.js#L47

wallet77 commented 6 years ago

So we need to log the full stack instead of just a simple error message ... am I right ?

Unitech commented 6 years ago

Yes a regular stack trace like for exception that would be muchhh better for sure

wallet77 commented 6 years ago

It's already done. We console.log a specific message for unhandledRejection but in any case we console.error the error stack trace. https://github.com/keymetrics/pmx-2/blob/55d397af8beb2ffc3d6fb9fed71d69d0ed66f07d/src/features/notify.ts#L81

Unitech commented 6 years ago

Good to close if that works

Unitech commented 6 years ago

Relating to https://github.com/Unitech/pm2/issues/3644 Do we still print the rejection in console with pmx-2?

vmarchaud commented 6 years ago

We console.log a specific message for unhandledRejection but in any case we console.error the error stack trace.