mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
http2: propagate abortsignal reason in new AbortError constructor
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/41008 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
1 file changed
+3
-1
@@ -1778,7 +1778,9 @@ class ClientHttp2Session extends Http2Session {
|
||||
const { signal } = options;
|
||||
if (signal) {
|
||||
validateAbortSignal(signal, 'options.signal');
|
||||
const aborter = () => stream.destroy(new AbortError());
|
||||
const aborter = () => {
|
||||
stream.destroy(new AbortError(undefined, { cause: signal.reason }));
|
||||
};
|
||||
if (signal.aborted) {
|
||||
aborter();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user