Skip to content

Expose the error from ReadableStream for Response methods via err.cause #1665

@saschanaz

Description

@saschanaz
new Response(new ReadableStream({
  pull(c) {
    c.error("oh");
  }
})).text()

Different browsers do different things:

  • Firefox logs a console message (invisible to JS)
  • Safari passes it to the message of DOMException (and thus objects may become [object Object] by stringification)
  • Chrome does not expose it in any way.

Should the spec define a way to do this? Maybe use the new error.cause?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions