MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / classifyBaseApiError

Function classifyBaseApiError

packages/kosong/src/errors.ts:118–126  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

116 * classifies as a timeout rather than a bare connection error.
117 */
118export function classifyBaseApiError(message: string): ChatProviderError {
119 if (TIMEOUT_RE.test(message)) {
120 return new APITimeoutError(message);
121 }
122 if (NETWORK_RE.test(message)) {
123 return new APIConnectionError(message);
124 }
125 return new ChatProviderError(`Error: ${message}`);
126}
127
128const CONTEXT_OVERFLOW_MESSAGE_PATTERNS = [
129 /context[ _-]?length/,

Callers 2

convertOpenAIErrorFunction · 0.90
convertAnthropicErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected