MCPcopy Create free account
hub / github.com/Y80/bmm / getErrorCode

Function getErrorCode

src/utils/http.ts:92–98  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

90}
91
92function getErrorCode(error: unknown): string {
93 const cause = error instanceof Error && 'cause' in error ? (error as { cause?: unknown }).cause : null
94 if (cause && typeof cause === 'object' && 'code' in cause) {
95 return String((cause as { code?: unknown }).code || '')
96 }
97 return ''
98}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected