Permalink
Please
sign in to comment.
Browse files
lib: refactor Error.captureStackTrace() usage
When using `Errors.captureStackFrames` the error's stack property is set again. This adds a helper function that wraps this functionality in a simple API that does not only set the stack including the `code` property but it also improves the performance to create the error. The helper works for thrown errors and errors returned from wrapped functions in case they are Node.js core errors. PR-URL: #26738 Fixes: #26669 Fixes: #20253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
- Loading branch information...
Showing
with
314 additions
and 337 deletions.
- +22 −37 lib/_http_outgoing.js
- +17 −20 lib/buffer.js
- +12 −9 lib/fs.js
- +2 −2 lib/internal/crypto/pbkdf2.js
- +59 −20 lib/internal/errors.js
- +43 −66 lib/internal/fs/utils.js
- +25 −24 lib/internal/http2/compat.js
- +12 −19 lib/internal/http2/core.js
- +30 −36 lib/internal/http2/util.js
- +1 −0 lib/internal/util/inspect.js
- +43 −54 lib/internal/validators.js
- +9 −6 lib/os.js
- +15 −14 lib/util.js
- +24 −25 lib/zlib.js
- +0 −5 test/common/wpt.js
Oops, something went wrong.
0 comments on commit
bfbce28