Skip to content

Add AbortablePromise#2215

Merged
fschinkel merged 1 commit into
releases/26.2from
features/fschinkel/26.2/AbortablePromise
Jun 9, 2026
Merged

Add AbortablePromise#2215
fschinkel merged 1 commit into
releases/26.2from
features/fschinkel/26.2/AbortablePromise

Conversation

@fschinkel

@fschinkel fschinkel commented Jun 1, 2026

Copy link
Copy Markdown
Member

An AbortablePromise is a native promise which is abortable. If it is not aborted it is resolved/rejected like a native promise. If it is aborted it is rejected with a CancelError. With this, one can distinguish between the promise being rejected because of an error or because it was aborted due to e.g. user interaction.
Move CancelError to scout.rt.

463545

Assisted-by: Sonnet 4.6, Haiku 4.5 (Claude Code)

@fschinkel fschinkel requested a review from cguglielmo June 1, 2026 07:40
@fschinkel fschinkel self-assigned this Jun 1, 2026
@fschinkel fschinkel marked this pull request as draft June 1, 2026 07:41
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/AbortablePromise branch 2 times, most recently from 31d52a2 to 83b30fe Compare June 1, 2026 20:26
@fschinkel fschinkel marked this pull request as ready for review June 1, 2026 20:27
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/AbortablePromise branch from 83b30fe to 8c8c0c0 Compare June 2, 2026 18:54
@fschinkel fschinkel requested a review from gabrielstalder June 3, 2026 12:14
An AbortablePromise is a native promise which is abortable. If it is not
aborted it is resolved/rejected like a native promise. If it is aborted
it is rejected with a CancelError. With this, one can distinguish
between the promise being rejected because of an error or because it was
aborted due to e.g. user interaction.
Move CancelError to scout.rt and rename it to AbortError.

463545

Assisted-by: Sonnet 4.6, Haiku 4.5 (Claude Code)
@fschinkel fschinkel force-pushed the features/fschinkel/26.2/AbortablePromise branch from 8c8c0c0 to e6aef2c Compare June 3, 2026 13:46
@fschinkel fschinkel merged commit 2fc6975 into releases/26.2 Jun 9, 2026
4 checks passed
@fschinkel fschinkel deleted the features/fschinkel/26.2/AbortablePromise branch June 9, 2026 15:50
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.

3 participants