MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / describeAxiosError

Function describeAxiosError

source code/bridge/debugUtils.ts:62–84  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

60 * since axios's default message only includes the status code.
61 */
62export function describeAxiosError(err: unknown): string {
63 const msg = errorMessage(err)
64 if (err && typeof err === 'object' && 'response' in err) {
65 const response = (err as { response?: { data?: unknown } }).response
66 if (response?.data && typeof response.data === 'object') {
67 const data = response.data as Record<string, unknown>
68 const detail =
69 typeof data.message === 'string'
70 ? data.message
71 : typeof data.error === 'object' &&
72 data.error &&
73 'message' in data.error &&
74 typeof (data.error as Record<string, unknown>).message ===
75 'string'
76 ? (data.error as Record<string, unknown>).message
77 : undefined
78 if (detail) {
79 return `${msg}: ${detail}`
80 }
81 }
82 }
83 return msg
84}
85
86/**
87 * Extract the HTTP status code from an axios error, if present.

Callers 2

startWorkPollLoopFunction · 0.85
runBridgeLoopFunction · 0.85

Calls 1

errorMessageFunction · 0.50

Tested by

no test coverage detected