MCPcopy Create free account
hub / github.com/cloudflare/mcp / errorCodeOf

Function errorCodeOf

src/metrics.ts:243–244  ·  view source on GitHub ↗
(e: unknown)

Source from the content-addressed store, hash-verified

241 const userId = userIdFromProps(props)
242
243 const errorCodeOf = (e: unknown): number =>
244 typeof (e as { code?: unknown })?.code === 'number' ? (e as { code: number }).code : -1
245
246 // Our tool callbacks signal failure by returning `{ isError: true }` rather
247 // than throwing, so inspect the resolved result as well as the thrown path.

Callers 1

attachMetricsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected