MCPcopy
hub / github.com/simstudioai/sim / onAbort

Function onAbort

apps/sim/lib/core/utils/stream-limits.ts:172–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170 }
171
172 const onAbort = () => {
173 if ('destroy' in stream && typeof stream.destroy === 'function') {
174 stream.destroy(toError(options.signal?.reason ?? new Error('Aborted')))
175 }
176 finish(() => reject(toError(options.signal?.reason ?? new Error('Aborted'))))
177 }
178
179 const onData = (chunk: Buffer | Uint8Array | string) => {
180 const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)

Callers 1

Calls 3

toErrorFunction · 0.90
finishFunction · 0.70
destroyMethod · 0.65

Tested by

no test coverage detected