mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 14:40:25 +00:00
fix: use relayAbort helper for addEventListener to preserve AbortError reason
This commit is contained in:
committed by
Peter Steinberger
parent
5ac8d1d2bb
commit
7ec60d6449
@@ -1,3 +1,5 @@
|
||||
import { bindAbortRelay } from "../utils/fetch-timeout.js";
|
||||
|
||||
type FetchWithPreconnect = typeof fetch & {
|
||||
preconnect: (url: string, init?: { credentials?: RequestCredentials }) => void;
|
||||
};
|
||||
@@ -42,7 +44,7 @@ export function wrapFetchWithAbortSignal(fetchImpl: typeof fetch): typeof fetch
|
||||
return fetchImpl(input, patchedInit);
|
||||
}
|
||||
const controller = new AbortController();
|
||||
const onAbort = controller.abort.bind(controller);
|
||||
const onAbort = bindAbortRelay(controller);
|
||||
if (signal.aborted) {
|
||||
controller.abort();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user