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

Mention passing errors in the docs #949

Merged
merged 5 commits into from
Jan 13, 2021
Merged

Mention passing errors in the docs #949

merged 5 commits into from
Jan 13, 2021

Conversation

vassbence
Copy link
Contributor

fixes #948

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit

docs/api.md Outdated Show resolved Hide resolved
Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

docs/api.md Outdated
<a id="errors"></a>
#### Errors

Errors can be supplied as either the first parameter or if already using `mergingObject` then as the `err` on the `mergingObject`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is accurate if the user has not customized the serializers, e.g.:

const logger = pino({
  serializers: {
    error: stdSerializers.error
  }
})

In the above, the err serializer, as described in this documentation, will not be defined. Instead, it is renamed to error. So:

// Will not serialize
logger.error({ err: Error('boom') })

// Will serialize
logger.error({ error: Error('boom') })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to point this out, let me know if you have a more concise sentence.

docs/api.md Outdated Show resolved Hide resolved
docs/api.md Outdated Show resolved Hide resolved
Co-authored-by: James Sumners <james@sumners.email>
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

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 2, 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.

Improve documentation about passing errors
3 participants