pino-std-serializers icon indicating copy to clipboard operation
pino-std-serializers copied to clipboard

feat: Support serializing primitives within Error causes (#158)

Open darcyrush opened this issue 1 year ago • 2 comments

Allow primitives to be returned as error causes when passed via the ErrorOptions object in an Error object constructor.

darcyrush avatar Nov 12 '24 13:11 darcyrush

An alternative that I looked into some years ago was to align with what Node.js itself does when it serializes: https://github.com/voxpelli/pony-cause/pull/23

Would be kind of nice to fix this "upstream" in pony-cause as well

voxpelli avatar Nov 28 '24 07:11 voxpelli

ping @jsumners

mcollina avatar Dec 07 '24 16:12 mcollina

This PR not merged into master?

lake2 avatar Jul 05 '25 09:07 lake2

@lake2 you can clearly see that it is not. Please read the comments of the review process. I pointed out that this PR does not actually serialize all non-Error objects into useful representations. Nothing has been to address that feedback. You are welcome to pick up the work if you like.

jsumners avatar Jul 05 '25 13:07 jsumners

Nothing has been to address that feedback.

To be fair, how I read the interaction was that there wasn't really much support from this project for logging non errors and the points made here were left unanswered.

From my point of view err.js is too opinionated and too simplified to be used with complex objects, but since its bundled with the library it feels like that ship has already sailed. It's understandable not to want to radically change the core output from a widely used library.

@lake2 - as @jsumners states, please feel free to pick up the work.

darcyrush avatar Jul 07 '25 05:07 darcyrush