Skip to content

Improve cancelSignal option #1108

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

Merged
merged 1 commit into from
May 28, 2024
Merged

Improve cancelSignal option #1108

merged 1 commit into from
May 28, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented May 28, 2024

This PR improves the cancelSignal option:

  • Does not emit the error event on the subprocess, so it does not disconnect IPC since some messages might still be buffered
  • Does not spawn the subprocess when passing an invalid cancelSignal type
  • Make error.message contain the error message passed to abortController.abort(), instead of error.cause.message
  • Clean up listeners on the AbortSignal even when the subprocess fails while spawning

@sindresorhus sindresorhus merged commit 3b56977 into main May 28, 2024
14 checks passed
@sindresorhus sindresorhus deleted the cancel-signal branch May 28, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants