trentm / node-bunyan

a simple and fast JSON logging module for node.js services
Other
7.15k stars 513 forks source link

Handle non-function `cause` field in error serializer #711

Open yelworc opened 11 months ago

yelworc commented 11 months ago

Current versions of Node.js/V8 formally added the cause property as an "official" error field, but are suggesting to store the source error object in it (as opposed to a function, as expected by Bunyan).

Bunyan should probably handle error-type cause properties accordingly in its default error serializer (it can still accept functions as before, of course, for the sake of backwards compatibility).

rpaterson commented 3 months ago

The cause property is a JS standard:

rpaterson commented 3 months ago

This would be fixed by #665