MCPcopy Create free account
hub / github.com/Noumena-Network/code / withCode

Function withCode

src/services/api/errorUtils.test.ts:5–11  ·  view source on GitHub ↗
(message: string, code: string, cause?: unknown)

Source from the content-addressed store, hash-verified

3import { formatAPIError, getSSLErrorHint } from './errorUtils.js'
4
5function withCode(message: string, code: string, cause?: unknown): Error {
6 const error = new Error(message, cause ? { cause } : undefined) as Error & {
7 code?: string
8 }
9 error.code = code
10 return error
11}
12
13function createApiError(
14 message: string | undefined,

Callers 1

errorUtils.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected