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

Function getFreebuffGateErrorKind

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

Source from the content-addressed store, hash-verified

192}
193
194export const getFreebuffGateErrorKind = (
195 error: unknown,
196): FreebuffGateErrorKind | null => {
197 if (!error || typeof error !== 'object') return null
198 const errorCode = (error as { error?: unknown }).error
199 const statusCode = (error as { statusCode?: unknown }).statusCode
200 if (typeof errorCode !== 'string') return null
201 const expected = FREEBUFF_GATE_STATUS[errorCode as FreebuffGateErrorKind]
202 if (expected === undefined || statusCode !== expected) return null
203 return errorCode as FreebuffGateErrorKind
204}
205
206export const OUT_OF_CREDITS_MESSAGE = `Out of credits. Please add credits at ${defaultAppUrl}/usage`
207

Callers 2

handleRunCompletionFunction · 0.90
handleRunErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected