Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the error serializer #18

Merged
merged 2 commits into from
Mar 31, 2016
Merged

Added the error serializer #18

merged 2 commits into from
Mar 31, 2016

Conversation

mcollina
Copy link
Member

@davidmarkclements please review

@davidmarkclements
Copy link
Member

I like that we're making this explicit

shouldn't we therefore remove the .stack check?
https://github.com/mcollina/pino/blob/errSerializer/pino.js#L100

I think that's wrong anyway, because it will interpret this {stack: 'meow'} as an error object too.

Also - is it redundant to add a test for an alternative type of error, e.g. try { x = u } catch (e) { pino.error({err: e}) } will be a ReferenceError

@mcollina
Copy link
Member Author

That check does a separate job:

error(new Error('aaaa'))

Which will also set the message.

If you pass { err: new Error('aaa') } it is something different: we are using the standard serializer thing.

@davidmarkclements davidmarkclements merged commit b26d617 into master Mar 31, 2016
@mcollina mcollina deleted the errSerializer branch March 31, 2016 16:51
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants