-
-
Notifications
You must be signed in to change notification settings - Fork 689
Labels
enhancementNew feature or requestNew feature or request
Description
Undici have the most crypting error message when sending in an already aborted signal.
example:
fetch('http://localhost', { signal: AbortSignal.abort('Already aborted') })
.catch(e => console.log({ctor: e.constructor.name, code: e.code, message: e.message}))undici:
{ ctor: 'TypeError', code: undefined, message: 'invalid_argument' }Chrome:
{ ctor: 'DOMException', code: 20, message: "Failed to execute 'fetch' on 'Window': The user aborted a request."}Safari:
{ ctor: "DOMException", code: 20, message: "Request signal is aborted"}Firefox & Deno:
{ ctor: "String", code: undefined, message: undefined }
// returns the abort reason, so the result is "Already aborted"
// With an undefined reason it throw
{ ctor: "DOMException", code: 20, message: "The operation was aborted. " }i tough i sent in something really wrong type when i was calling fetch when i received a TypeError.
but it's of a correct "type".
{ signal: "foo" } is an TypeError and a invalid argument.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request