MCPcopy
hub / github.com/TanStack/ai / createErrorChunks

Function createErrorChunks

packages/ai-solid/tests/use-generation.test.ts:80–97  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

78// `chunk.message ?? chunk.error?.message`). Once that fallback is removed, the
79// `error` field can drop.
80function createErrorChunks(message: string): Array<StreamChunk> {
81 return [
82 {
83 type: EventType.RUN_STARTED,
84 runId: 'run-1',
85 threadId: 'thread-1',
86 timestamp: Date.now(),
87 },
88 {
89 type: EventType.RUN_ERROR,
90 message,
91 // Legacy shape preserved for the fallback branch in generation-client.ts.
92 // AGUIEventSchema is `passthrough` so unknown keys are allowed at runtime;
93 // the strict TS union still requires a cast on this single chunk.
94 error: { message },
95 } as StreamChunk,
96 ]
97}
98
99describe('useGeneration', () => {
100 describe('initialization', () => {

Callers 1

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected