MCPcopy Create free account
hub / github.com/TanStack/ai / createErrorStream

Function createErrorStream

examples/ts-react-native-chat/src/server/app.ts:398–414  ·  view source on GitHub ↗
(
  error: unknown,
  body: unknown,
)

Source from the content-addressed store, hash-verified

396}
397
398async function* createErrorStream(
399 error: unknown,
400 body: unknown,
401): AsyncIterable<StreamChunk> {
402 const message = getErrorMessage(error)
403
404 yield {
405 type: EventType.RUN_ERROR,
406 ...getRequestRunContext(body),
407 message,
408 code: 'REACT_NATIVE_EXAMPLE_SERVER_ERROR',
409 error: {
410 message,
411 code: 'REACT_NATIVE_EXAMPLE_SERVER_ERROR',
412 },
413 }
414}
415
416export const app = new Hono()
417

Callers 1

app.tsFile · 0.85

Calls 2

getErrorMessageFunction · 0.85
getRequestRunContextFunction · 0.85

Tested by

no test coverage detected