{"record":{"id":"a437e00c5ab6b924","repo":"BerriAI/litellm","slug":"anthropicexception-error-str","errorCode":null,"errorMessage":"AnthropicException - {error_str}","messagePattern":"AnthropicException - (.+?)","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":548,"sourceCode":"            model=model,\n            llm_provider=\"anthropic\",\n        )\n    if \"content filtering policy\" in error_str:\n        raise ContentPolicyViolationError(\n            message=f\"AnthropicError - {error_str}\",\n            model=model,\n            llm_provider=\"anthropic\",\n        )\n    if \"Client error '400 Bad Request'\" in error_str:\n        raise BadRequestError(\n            message=f\"AnthropicError - {error_str}\",\n            model=model,\n            llm_provider=\"anthropic\",\n        )\n    if hasattr(original_exception, \"status_code\"):\n        verbose_logger.debug(\"status_code: %s\", original_exception.status_code)\n        if original_exception.status_code == 401:\n            raise AuthenticationError(\n                message=f\"AnthropicException - {error_str}\",\n                llm_provider=\"anthropic\",\n                model=model,\n            )\n        elif original_exception.status_code == 400 or original_exception.status_code == 413:\n            raise BadRequestError(\n                message=f\"AnthropicException - {error_str}\",\n                model=model,\n                llm_provider=\"anthropic\",\n            )\n        elif original_exception.status_code == 404:\n            raise NotFoundError(\n                message=f\"AnthropicException - {error_str}\",\n                model=model,\n                llm_provider=\"anthropic\",\n            )\n        elif original_exception.status_code == 408:\n            raise Timeout(","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L530-L566","documentation":"Error \"AnthropicException - {error_str}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the Anthropic exception message; adjust the request or credentials accordingly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}