MCPcopy
hub / github.com/simstudioai/sim / getErrorMessage

Function getErrorMessage

packages/utils/src/errors.ts:19–23  ·  view source on GitHub ↗
(value: unknown, fallback?: string)

Source from the content-addressed store, hash-verified

17 * - Otherwise → `fallback` if provided, or `String(value)`
18 */
19export function getErrorMessage(value: unknown, fallback?: string): string {
20 if (value instanceof Error) return value.message
21 if (typeof value === 'string' && value.length > 0) return value
22 return fallback ?? String(value)
23}
24
25/**
26 * Returns PostgreSQL error code (e.g. `23505` for unique_violation) when present on a thrown value.

Callers 15

sendWithRetryFunction · 0.90
parseSecretJsonFunction · 0.90
registerSSOProviderFunction · 0.90
deregisterSSOProviderFunction · 0.90
runBackfillFunction · 0.90
executeMcpToolFunction · 0.90
callOperationFunction · 0.90
share_post.tsFile · 0.90
parseJsonFieldFunction · 0.90
parseCsvOrJsonFunction · 0.90
get_object.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected