MCPcopy Index your code
hub / github.com/simstudioai/sim / messageFromErrorBody

Function messageFromErrorBody

apps/sim/lib/api/client/request.ts:137–145  ·  view source on GitHub ↗
(body: unknown, fallback: string)

Source from the content-addressed store, hash-verified

135}
136
137function messageFromErrorBody(body: unknown, fallback: string): string {
138 if (body && typeof body === 'object') {
139 const record = body as Record<string, unknown>
140 const message = record.message ?? record.error
141 if (typeof message === 'string' && message.length > 0) return message
142 }
143
144 return fallback
145}
146
147function codeFromErrorBody(body: unknown): string | undefined {
148 if (body && typeof body === 'object') {

Callers 2

requestJsonFunction · 0.85
requestRawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected