BridgeAR · GitHub

@BridgeAR added assert

Issues and PRs related to the assert subsystem.

semver-major

PRs that contain breaking changes and should be released in the next major version.

notable-change

PRs with changes that should be highlighted in changelogs.

labels

Jan 19, 2018

BridgeAR

mcollina

@BridgeAR

mcollina

It is hard to know where ifError is actually triggered due to the
original error being thrown.
This changes it by wrapping the original error in a AssertionError.
This has the positive effect of also making clear that it is indeed
a assertion function that triggered that error.
The original stack can still be accessed by checking the `actual`
property.
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
This makes `assert.ifError` stricter by only accepting `null` and
`undefined` from now on. Before any truthy value was accepted.

@BridgeAR

@BridgeAR BridgeAR changed the title assert: wrap original error in ifError assert: improve ifError

Jan 23, 2018

mcollina

BridgeAR added a commit to BridgeAR/node that referenced this pull request

Jan 24, 2018
It is hard to know where ifError is actually triggered due to the
original error being thrown.
This changes it by wrapping the original error in a AssertionError.
This has the positive effect of also making clear that it is indeed
a assertion function that triggered that error.
The original stack can still be accessed by checking the `actual`
property.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

BridgeAR added a commit to BridgeAR/node that referenced this pull request

Jan 24, 2018
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

BridgeAR added a commit to BridgeAR/node that referenced this pull request

Jan 24, 2018
This makes `assert.ifError` stricter by only accepting `null` and
`undefined` from now on. Before any truthy value was accepted.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

BridgeAR added a commit to BridgeAR/node that referenced this pull request

Mar 8, 2018
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins pushed a commit that referenced this pull request

Mar 15, 2018
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
Backport-PR-URL: #19230
PR-URL: #18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Merged

MylesBorins pushed a commit that referenced this pull request

Mar 20, 2018
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
Backport-PR-URL: #19230
PR-URL: #18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request

May 8, 2018
It is hard to know where ifError is actually triggered due to the
original error being thrown.
This changes it by wrapping the original error in a AssertionError.
This has the positive effect of also making clear that it is indeed
a assertion function that triggered that error.
The original stack can still be accessed by checking the `actual`
property.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request

May 8, 2018
Destructure the necessary Error classes from internal/errors.
This improves the readability of the error creation.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request

May 8, 2018
This makes `assert.ifError` stricter by only accepting `null` and
`undefined` from now on. Before any truthy value was accepted.
PR-URL: nodejs#18247
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@BridgeAR

BridgeAR deleted the improve-assert-iferror branch

April 1, 2019 23:38

Read the original on github.com ↗