Skip to content
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

feat: rework promise interface #9

Merged
merged 1 commit into from
Jun 16, 2024
Merged

feat: rework promise interface #9

merged 1 commit into from
Jun 16, 2024

Conversation

43081j
Copy link
Member

@43081j 43081j commented Jun 16, 2024

Reworks the promise .then to be greatly simplified.

As part of this, error handling has also been improved in a few ways:

  • Timeouts are now handled by an AbortSignal rather than the built-in timeout option, as there is currently no way to know if a proc was killed due to a timeout.
  • The last error is stored until we await the result, at which point, we will throw the stored error
  • We wait for the process to close before trying to read the output, in case it threw

Reworks the promise `.then` to be greatly simplified.

As part of this, error handling has also been improved in a few ways:

- Timeouts are now handled by an `AbortSignal` rather than the built-in
  `timeout` option, as there is currently no way to know if a proc was
killed due to a timeout.
- The last error is stored until we `await` the result, at which point,
  we will throw the stored error
- We wait for the process to close before trying to read the output, in
  case it threw
@43081j 43081j merged commit 8dc684e into main Jun 16, 2024
4 checks passed
@43081j 43081j deleted the promise-rework branch June 16, 2024 10:53
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.

1 participant