claude error messages
This commit is contained in:
@@ -455,7 +455,9 @@ async function handleAnthropicAwsBadRequestError(
|
||||
// {"type":"error","error":{"type":"invalid_request_error","message":"Your credit balance is too low to access the Claude API. Please go to Plans & Billing to upgrade or purchase credits."}}
|
||||
const isOverQuota =
|
||||
error?.message?.match(/usage blocked until/i) ||
|
||||
error?.message?.match(/credit balance is too low/i);
|
||||
error?.message?.match(/credit balance is too low/i) ||
|
||||
error?.message?.match(/You will regain access on/i) ||
|
||||
error?.message?.match(/reached your specified API usage limits/i);
|
||||
if (isOverQuota) {
|
||||
req.log.warn(
|
||||
{ key: req.key?.hash, message: error?.message },
|
||||
@@ -468,7 +470,8 @@ async function handleAnthropicAwsBadRequestError(
|
||||
|
||||
const isDisabled =
|
||||
error?.message?.match(/organization has been disabled/i) ||
|
||||
error?.message?.match(/^operation not allowed/i);
|
||||
error?.message?.match(/^operation not allowed/i) ||
|
||||
error?.message?.match(/credential is only authorized for use with Claude Code/i);
|
||||
if (isDisabled) {
|
||||
req.log.warn(
|
||||
{ key: req.key?.hash, message: error?.message },
|
||||
|
||||
@@ -76,7 +76,8 @@ export class AnthropicKeyChecker extends KeyCheckerBase<AnthropicKey> {
|
||||
data.error?.message?.match(/You will regain access on/i);
|
||||
const isDisabled = data.error?.message?.match(
|
||||
/organization has been disabled/i
|
||||
);
|
||||
) ||
|
||||
data.error?.message?.match(/credential is only authorized for use with Claude Code/i);
|
||||
if (status === 400 && isOverQuota) {
|
||||
this.log.warn(
|
||||
{ key: key.hash, error: data },
|
||||
|
||||
Reference in New Issue
Block a user