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

Improve documentation about passing errors #948

Closed
vassbence opened this issue Jan 13, 2021 · 3 comments · Fixed by #949
Closed

Improve documentation about passing errors #948

vassbence opened this issue Jan 13, 2021 · 3 comments · Fixed by #949

Comments

@vassbence
Copy link
Contributor

Hi!

We should improve docs about when and where can/should one pass an Error to be correctly serialized, for example .error(new Error("test"))" and .info({err: new Error("test")}) works but .warn(new Error("test")) does not.

Would a dev be so kind as to list out all the possible variations? So that I can submit a PR and make it clear in the docs that when does pino serialize errors and when it not.

@mcollina
Copy link
Member

What you listed is all of it! Thanks for offering to send a PR.

What's not working with .warn(new Error("test"))? This should work as expected (an error logged at the "Warn" level).

@vassbence
Copy link
Contributor Author

Submitted the PR.

About .warn(): I think I just messed something up on my end, checked it again and passing errors works as expected.

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This issue 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 4, 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 a pull request may close this issue.

2 participants