MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / rejectAsAbort

Function rejectAsAbort

packages/core/sdk/src/hosted-http-client.ts:592–600  ·  view source on GitHub ↗
(signal: AbortSignal)

Source from the content-addressed store, hash-verified

590// which callers branching on `error.name === "AbortError"` read as a transport
591// failure and retry. This is a Fetch adapter, so it rejects the way fetch does.
592const rejectAsAbort = (signal: AbortSignal): never => {
593 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: Fetch-compatible adapter must reject with the caller's own abort reason
594 if (signal.reason !== undefined) throw signal.reason;
595 // oxlint-disable-next-line executor/no-error-constructor -- boundary: Fetch-compatible adapter must reject with an AbortError-shaped value
596 const error = new Error("The operation was aborted");
597 error.name = "AbortError";
598 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: Fetch-compatible adapter must reject with an AbortError-shaped value
599 throw error;
600};
601
602// One place the guard's verdict becomes a rejected Promise. Each call site had
603// its own `Effect.runPromise(Effect.fail(...))`, which is a fresh fiber per

Callers 1

guardFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected