MCPcopy Index your code
hub / github.com/TanStack/ai / runErrorFromChunk

Function runErrorFromChunk

packages/ai-sandbox/src/run.ts:25–31  ·  view source on GitHub ↗

Pull `{ message, code }` off a RUN_ERROR chunk for the run record.

(
  chunk: StreamChunk & { message: string; code?: string },
)

Source from the content-addressed store, hash-verified

23
24/** Pull `{ message, code }` off a RUN_ERROR chunk for the run record. */
25function runErrorFromChunk(
26 chunk: StreamChunk & { message: string; code?: string },
27): RunError {
28 return chunk.code !== undefined
29 ? { message: chunk.message, code: chunk.code }
30 : { message: chunk.message }
31}
32
33/** Render an unknown thrown value as a stable error message. */
34function messageOf(error: unknown): string {

Callers 1

pipeToRunLogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected