Skip to content

When a promise is aborted using AbortSignal, the reason of the abort is not preserved #7035

Description

@logan-gatlin

When a promise is aborted using AbortSignal, the reason of the abort is not preserved - it becomes a generic error object instead. This caused a number of new WPT test failures (#7021):

  • Aborting rejects with abort reason when aborted after fetch() called
  • response.arrayBuffer() rejects with abort reason if already aborted
  • response.blob() rejects with abort reason if already aborted
  • response.bytes() rejects with abort reason if already aborted
  • response.formData() rejects with abort reason if already aborted
  • response.json() rejects with abort reason if already aborted
  • response.text() rejects with abort reason if already aborted
  • Stream errors once aborted with abort reason. Underlying connection closed.

There are also several tests that predate #7021 and are marked as expected failures, for the same reasons:

  • Aborting rejects with AbortError
  • Aborting rejects with abort reason
  • Already aborted signal rejects immediately

This is probably due to exception tunneling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions