0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib/internal/fs
Ruben Bridgewater bfbce289c3
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: https://github.com/nodejs/node/pull/26738
Fixes: https://github.com/nodejs/node/issues/26669
Fixes: https://github.com/nodejs/node/issues/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>
2019-03-23 02:55:54 +01:00
..
promises.js fs: make process.binding('fs') internal 2018-11-16 21:56:29 +09:00
read_file_context.js benchmark,doc,lib,test: capitalize comments 2019-02-28 18:31:10 +01:00
streams.js benchmark,doc,lib,test: capitalize comments 2019-02-28 18:31:10 +01:00
sync_write_stream.js fs: use proper .destroy() implementation for SyncWriteStream 2019-03-18 10:30:07 +01:00
utils.js lib: refactor Error.captureStackTrace() usage 2019-03-23 02:55:54 +01:00
watchers.js benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00