mirror of https://github.com/nodejs/node.git
quic: use AbortController with correct name/message
On the web, `AbortError` is the error name, not the error message. Change the code to match that. PR-URL: https://github.com/nodejs/node/pull/34763 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>pull/34769/head
parent
9594b54f96
commit
ba5c64bf45
|
@ -253,10 +253,10 @@ let warnedVerifyHostnameIdentity = false;
|
|||
|
||||
let DOMException;
|
||||
|
||||
const lazyDOMException = hideStackFrames((message) => {
|
||||
const lazyDOMException = hideStackFrames((message, name) => {
|
||||
if (DOMException === undefined)
|
||||
DOMException = internalBinding('messaging').DOMException;
|
||||
return new DOMException(message);
|
||||
return new DOMException(message, name);
|
||||
});
|
||||
|
||||
assert(process.versions.ngtcp2 !== undefined);
|
||||
|
@ -664,10 +664,10 @@ class QuicEndpoint {
|
|||
if (signal != null && !('aborted' in signal))
|
||||
throw new ERR_INVALID_ARG_TYPE('options.signal', 'AbortSignal', signal);
|
||||
|
||||
// If an AbotSignal was passed in, check to make sure it is not already
|
||||
// If an AbortSignal was passed in, check to make sure it is not already
|
||||
// aborted before we continue on to do any work.
|
||||
if (signal && signal.aborted)
|
||||
throw new lazyDOMException('AbortError');
|
||||
throw new lazyDOMException('The operation was aborted', 'AbortError');
|
||||
|
||||
state.state = kSocketPending;
|
||||
|
||||
|
@ -685,7 +685,7 @@ class QuicEndpoint {
|
|||
// while we were waiting.
|
||||
if (signal && signal.aborted) {
|
||||
state.state = kSocketUnbound;
|
||||
throw new lazyDOMException('AbortError');
|
||||
throw new lazyDOMException('The operation was aborted', 'AbortError');
|
||||
}
|
||||
|
||||
// From here on, any errors are fatal for the QuicEndpoint. Keep in
|
||||
|
@ -1064,7 +1064,7 @@ class QuicSocket extends EventEmitter {
|
|||
// If an AbotSignal was passed in, check to make sure it is not already
|
||||
// aborted before we continue on to do any work.
|
||||
if (signal && signal.aborted)
|
||||
throw new lazyDOMException('AbortError');
|
||||
throw new lazyDOMException('The operation was aborted', 'AbortError');
|
||||
|
||||
state.state = kSocketPending;
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ class QuicSocket extends EventEmitter {
|
|||
// Some number of endpoints may have successfully bound, while
|
||||
// others have not
|
||||
if (signal && signal.aborted)
|
||||
throw lazyDOMException('AbortError');
|
||||
throw lazyDOMException('The operation was aborted', 'AbortError');
|
||||
|
||||
state.state = kSocketBound;
|
||||
|
||||
|
|
Loading…
Reference in New Issue