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

Function isOutOfCreditsError

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

Source from the content-addressed store, hash-verified

34 * Standardized on statusCode === 402 for payment required detection.
35 */
36export const isOutOfCreditsError = (error: unknown): boolean => {
37 if (
38 error &&
39 typeof error === 'object' &&
40 'statusCode' in error &&
41 (error as { statusCode: unknown }).statusCode === 402
42 ) {
43 return true
44 }
45 return false
46}
47
48/**
49 * Check if an error indicates free mode is not available in the user's country.

Callers 3

handleRunCompletionFunction · 0.90
handleRunErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected