Problem is that JSON.stringify() is not able to stringify Error instance, so If we put Error instance into our context we are going to see just {} which is annoying.
So I propose to maybe handle remapping part of context if its Error instance or something like that? But not sure it should be package or developer responsibility yet 🙆♂
Your package uses https://www.npmjs.com/package/@pm2/agent-node this one, so if we
notifyError()
that finally use WS agent to send our data out then WS agent makewhere agent is:
And if we dig into https://github.com/keymetrics/pm2-io-agent-node/blob/master/src/transport.js we find out that sending is handled by:
Problem is that
JSON.stringify()
is not able to stringifyError instance
, so If we putError instance
into our context we are going to see just{}
which is annoying.So I propose to maybe handle remapping part of context if its Error instance or something like that? But not sure it should be package or developer responsibility yet 🙆♂