MCPcopy
hub / github.com/claude-code-best/claude-code / toError

Function toError

src/utils/errors.ts:111–113  ·  view source on GitHub ↗
(e: unknown)

Source from the content-addressed store, hash-verified

109 * Use at catch-site boundaries when you need an Error instance.
110 */
111export function toError(e: unknown): Error {
112 return e instanceof Error ? e : new Error(String(e))
113}
114
115/**
116 * Extract a string message from an unknown error-like value.

Callers 15

errors.test.tsFile · 0.90
patchConsoleMethod · 0.85
getSkillInfoFunction · 0.85
callFunction · 0.85
validateInputFunction · 0.85
callFunction · 0.85
getSkillsFunction · 0.85
commands.tsFile · 0.85
runFunction · 0.85
fetchInfoFunction · 0.85
AgentsMenuFunction · 0.85
persistBinaryContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected