MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / throwIfAborted

Function throwIfAborted

packages/kosong/src/generate.ts:266–276  ·  view source on GitHub ↗
(signal?: AbortSignal, stream?: StreamedMessage)

Source from the content-addressed store, hash-verified

264}
265
266async function throwIfAborted(signal?: AbortSignal, stream?: StreamedMessage): Promise<void> {
267 if (!signal?.aborted) {
268 return;
269 }
270
271 if (stream !== undefined) {
272 await cancelStream(stream);
273 }
274
275 throwAbortError();
276}
277
278/** True when `pending` is a ToolCall whose _streamIndex equals `index`. */
279function isPendingToolCallAtIndex(

Callers 1

generateFunction · 0.70

Calls 2

cancelStreamFunction · 0.85
throwAbortErrorFunction · 0.70

Tested by

no test coverage detected