-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process.exec(...)
(and fork
, spawn
) do not abort with expected signal.reason
#47814
Comments
That's a bad API since signals get passed into things the code around it can't predict what exceptions may be thrown. The current behavior is intentional and what |
@benjamingr Your idea from #43874 to put the It seems like things are converging on throwing |
Fixes: nodejs#47814 PR-URL: nodejs#47817 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Version
v18.16.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
v18.16.0
AbortError: The operation was aborted
instead of our customsignal.reason
->Error: My custom error
How often does it reproduce? Is there a required condition?
Consistently reproducible (always)
What is the expected behavior? Why is that the expected behavior?
I expect this to behave like the
fetch
API where the error thrown is thesignal.reason
that we aborted with. Example:What do you see instead?
It always throws:
AbortError: The operation was aborted
Additional information
Related to #43874
The text was updated successfully, but these errors were encountered: