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

Function getApiErrorStatusCode

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

Source from the content-addressed store, hash-verified

287}
288
289function getApiErrorStatusCode(error: unknown): number | undefined {
290 if (!error || typeof error !== 'object') return undefined
291
292 if ('statusCode' in error) {
293 const statusCode = (error as { statusCode: unknown }).statusCode
294 if (typeof statusCode === 'number') return statusCode
295 }
296
297 if ('status' in error) {
298 const status = (error as { status: unknown }).status
299 if (typeof status === 'number') return status
300 }
301
302 return undefined
303}
304
305function getApiErrorResponseBody(error: unknown): unknown {
306 if (!error || typeof error !== 'object') return undefined

Callers 1

extractApiErrorDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected