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

Function extractApiErrorDetails

common/src/util/error.ts:328–342  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

326 * `lastError` / `errors`.
327 */
328export function extractApiErrorDetails(error: unknown): ApiErrorDetails {
329 for (const candidate of getApiErrorCandidates(error)) {
330 const statusCode = getApiErrorStatusCode(candidate)
331 const parsed = parseApiErrorResponseBody(getApiErrorResponseBody(candidate))
332
333 if (statusCode !== undefined || hasParsedApiErrorDetails(parsed)) {
334 return {
335 ...parsed,
336 ...(statusCode !== undefined && { statusCode }),
337 }
338 }
339 }
340
341 return {}
342}
343
344// Extended error properties that various libraries add to Error objects
345interface ExtendedErrorProperties {

Callers 4

loopAgentStepsFunction · 0.90
getCliApiErrorDetailsFunction · 0.90
runOnceFunction · 0.90

Calls 5

getApiErrorCandidatesFunction · 0.85
getApiErrorStatusCodeFunction · 0.85
getApiErrorResponseBodyFunction · 0.85
hasParsedApiErrorDetailsFunction · 0.85

Tested by

no test coverage detected