Skip to content

Commit

Permalink
fixup! add comment to handleErrorFromBinding
Browse files Browse the repository at this point in the history
Co-authored-by: Joyee Cheung <[email protected]>
  • Loading branch information
sapphi-red and joyeecheung authored Oct 6, 2023
1 parent b96887d commit b8b3a5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ function lazyFsStreams() {
return fsStreams ??= require('internal/fs/streams');
}

// By the time the C++ land creates an error for a promise rejection (likely from a
// libuv callback), there is already no JS frames on the stack. So we need to
// wait until V8 resumes execution back to JS land before we have enough information
// to re-capture the stack trace.
function handleErrorFromBinding(error) {
ErrorCaptureStackTrace(error, handleErrorFromBinding);
return PromiseReject(error);
Expand Down

0 comments on commit b8b3a5c

Please sign in to comment.