Skip to content

aborting should throw a DOMException #1519

@jimmywarting

Description

@jimmywarting

Hmm, wondering if not we should try to fix the real problem that is that we return a custom AbortError message, it should rather be a DOMException

// Browser test:
ctrl = new AbortController() 
ctrl.abort()
fetch('/', ctrl).catch(console.log) 
// DOMException { 
//   name: AbortError,
//   code: 20,
//   message: "Failed to execute 'fetch' on 'Window': The user aborted a request." 
// }

We could optionally start to depend on node-domexception. it's already included by another sub dependency of ours (fetch-blob).

Originally posted by @jimmywarting in #1513 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions