mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:01:24 +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,5 +1,6 @@
|
||||
import type { Dispatcher } from "undici";
|
||||
import { logWarn } from "../../logger.js";
|
||||
import { bindAbortRelay } from "../../utils/fetch-timeout.js";
|
||||
import {
|
||||
closeDispatcher,
|
||||
createPinnedDispatcher,
|
||||
@@ -51,7 +52,7 @@ function buildAbortSignal(params: { timeoutMs?: number; signal?: AbortSignal }):
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(controller.abort.bind(controller), timeoutMs);
|
||||
const onAbort = controller.abort.bind(controller);
|
||||
const onAbort = bindAbortRelay(controller);
|
||||
if (signal) {
|
||||
if (signal.aborted) {
|
||||
controller.abort();
|
||||
|
||||
Reference in New Issue
Block a user