Skip to content

Commit fa5ac5a

Browse files
jasnelltargos
authored andcommittedAug 1, 2022
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 046deba commit fa5ac5a

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
@@ -1793,7 +1793,9 @@ class ClientHttp2Session extends Http2Session {
17931793
const { signal } = options;
17941794
if (signal) {
17951795
validateAbortSignal(signal, 'options.signal');
1796-
const aborter = () => stream.destroy(new AbortError());
1796+
const aborter = () => {
1797+
stream.destroy(new AbortError(undefined, { cause: signal.reason }));
1798+
};
17971799
if (signal.aborted) {
17981800
aborter();
17991801
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.