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

Function extractLinqError

apps/sim/tools/linq/utils.ts:15–26  ·  view source on GitHub ↗
(data: unknown, fallback: string)

Source from the content-addressed store, hash-verified

13
14/** Extract a human-readable error message from a Linq error response body. */
15export function extractLinqError(data: unknown, fallback: string): string {
16 if (data && typeof data === 'object') {
17 const record = data as Record<string, unknown>
18 const error = record.error
19 if (error && typeof error === 'object') {
20 const message = (error as Record<string, unknown>).message
21 if (typeof message === 'string' && message.length > 0) return message
22 }
23 if (typeof record.message === 'string' && record.message.length > 0) return record.message
24 }
25 return fallback
26}
27
28interface MessageContentInput {
29 text?: string

Calls

no outgoing calls

Tested by

no test coverage detected