MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getCliApiErrorDetails

Function getCliApiErrorDetails

cli/src/utils/error-handling.ts:102–116  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

100}
101
102const getCliApiErrorDetails = (error: unknown) => {
103 const parsed = extractApiErrorDetails(error)
104 const topLevel = getTopLevelApiErrorDetails(error)
105
106 return {
107 statusCode: topLevel.statusCode ?? parsed.statusCode,
108 errorCode: topLevel.errorCode ?? parsed.errorCode,
109 // Prefer responseBody messages over top-level HTTP status text.
110 message: parsed.message ?? topLevel.message,
111 countryCode: topLevel.countryCode ?? parsed.countryCode,
112 countryBlockReason:
113 topLevel.countryBlockReason ?? parsed.countryBlockReason,
114 ipPrivacySignals: topLevel.ipPrivacySignals ?? parsed.ipPrivacySignals,
115 }
116}
117
118export const getFreebuffRateLimitErrorMessage = (
119 error: unknown,

Calls 2

extractApiErrorDetailsFunction · 0.90

Tested by

no test coverage detected