MCPcopy Index your code
hub / github.com/continuedev/continue / formatAnthropicError

Function formatAnthropicError

extensions/cli/src/util/formatError.ts:56–71  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

54
55// Anthropic errors are stringfied JSON objects, format them to be more user friendly
56export function formatAnthropicError(error: any): string {
57 const prefix = "Anthropic:";
58
59 if (error instanceof Error) {
60 if (
61 error.message.includes("authentication_error") &&
62 error.message.includes("invalid x-api-key")
63 ) {
64 return `${prefix} Invalid API key`;
65 }
66
67 return `${prefix} ${error.message}`;
68 }
69
70 return `${prefix} ${String(error)}`;
71}

Callers 2

processMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected