src: add SetAbortHandler#64684
Open
maxhfisher wants to merge 4 commits into
Open
Conversation
Signed-off-by: Max H Fisher <mfisher187@bloomberg.net>
Collaborator
|
Review requested:
|
legendecas
reviewed
Jul 23, 2026
legendecas
reviewed
Jul 23, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64684 +/- ##
==========================================
+ Coverage 90.11% 90.12% +0.01%
==========================================
Files 741 743 +2
Lines 242196 242334 +138
Branches 45606 45637 +31
==========================================
+ Hits 218246 218398 +152
- Misses 15438 15445 +7
+ Partials 8512 8491 -21
🚀 New features to boost your workflow:
|
Signed-off-by: Max H Fisher <mfisher187@bloomberg.net>
legendecas
reviewed
Jul 24, 2026
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
SetAbortHandler, which allows embedders to specify custom behavior in situations whereABORT()is called. The current behavior ofABORT()is to stream both the native and JS backtraces tostderrand exit with platform specific behavior. Some embedders may want to change this behavior, such as changing where the backtrace is provided. Embedders can also use the handler to exit with their own behavior, but node will still guarantee an exit if the provided abort handler returns.A
DefaultAbortHandleris used to ensure existing behavior does not change unless an abort handler is explicitly provided. The only difference with this design is an additional stack frame in the backtrace for the abort handler, but this behavior was never guaranteed.A new
ABORT_WITH_MESSAGEmacro is also added for cases where a message can be passed describing the reason for the abort. This new macro replaces existing calls toABORTin various error handlers innode_errors.ccwhere a message is already available. This message is then propagated to the abort handler, but no changes are made to the default abort handler. That behavior does not change here.