{"record":{"id":"b431d83db54541b3","repo":"BerriAI/litellm","slug":"counttokens-processing-error-e","errorCode":null,"errorMessage":"CountTokens processing error: {e}","messagePattern":"CountTokens processing error: (.+?)","errorType":"http","errorClass":"AnthropicError","httpStatus":500,"severity":"error","filePath":"litellm/llms/anthropic/count_tokens/handler.py","lineNumber":119,"sourceCode":"\n            verbose_logger.debug(\"Anthropic response: %s\", anthropic_response)\n\n            # Return Anthropic response directly - no transformation needed\n            return anthropic_response\n\n        except AnthropicError:\n            # Re-raise Anthropic exceptions as-is\n            raise\n        except httpx.HTTPStatusError as e:\n            # HTTP errors - preserve the actual status code\n            verbose_logger.error(\"HTTP error in CountTokens handler: %s\", e)\n            raise AnthropicError(\n                status_code=e.response.status_code,\n                message=e.response.text,\n            )\n        except Exception as e:\n            verbose_logger.error(\"Error in CountTokens handler: %s\", e)\n            raise AnthropicError(\n                status_code=500,\n                message=f\"CountTokens processing error: {e}\",\n            )\n","sourceCodeStart":101,"sourceCodeEnd":123,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/anthropic/count_tokens/handler.py#L101-L123","documentation":"Error \"CountTokens processing error: {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/count_tokens/handler.py:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the count-tokens request payload; see the wrapped exception."],"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"}