Skip to content

[Docs] Wrong definition of assert.ifError(value) #58572

Description

@pr4j3sh

The definition provided for assert.ifError(value) here contains value, instead of AssertionError.

Actual Definition

Throws value if value is not undefined or null. This is useful when testing the error argument in callbacks. The stack trace contains all frames from the error passed to ifError() including the potential new frames for ifError() itself.

The second word, should be AssertionError.

Changes
Changing this line in lib/assert.js would fix this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions