assert: wrap original error in ifError
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: https://github.com/nodejs/node/pull/18247 Reviewed-By:Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
parent
7a23fc07
Please register or sign in to comment