MCPcopy Index your code
hub / github.com/21st-dev/1code / extractCodexError

Function extractCodexError

src/main/lib/trpc/routers/codex.ts:327–341  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

325}
326
327function extractCodexError(error: unknown): { message: string; code?: string } {
328 const anyError = error as any
329 const message =
330 anyError?.data?.message ||
331 anyError?.errorText ||
332 anyError?.message ||
333 anyError?.error ||
334 String(error)
335 const code = anyError?.data?.code || anyError?.code
336
337 return {
338 message: typeof message === "string" ? message : String(message),
339 code: typeof code === "string" ? code : undefined,
340 }
341}
342
343function isCodexAuthError(params: {
344 message?: string | null

Callers 1

codex.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected