Skip to content

Commit 4b3bf7e

Browse files
jasnelldanielleadams
authored andcommitted
http2: propagate abortsignal reason in new AbortError constructor
Signed-off-by: James M Snell <[email protected]> PR-URL: #41008 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 01e8c15 commit 4b3bf7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/http2/core.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,9 @@ class ClientHttp2Session extends Http2Session {
17781778
const { signal } = options;
17791779
if (signal) {
17801780
validateAbortSignal(signal, 'options.signal');
1781-
const aborter = () => stream.destroy(new AbortError());
1781+
const aborter = () => {
1782+
stream.destroy(new AbortError(undefined, { cause: signal.reason }));
1783+
};
17821784
if (signal.aborted) {
17831785
aborter();
17841786
} else {

0 commit comments

Comments
 (0)