{"record":{"id":"af9fb00775b59e5c","repo":"BerriAI/litellm","slug":"this-is-a-mock-internal-server-error","errorCode":null,"errorMessage":"this is a mock internal server error","messagePattern":"this is a mock internal server error","errorType":"http","errorClass":"InternalServerError","httpStatus":500,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/messages/utils.py","lineNumber":74,"sourceCode":"\ndef mock_response(\n    model: str,\n    messages: list[dict],\n    max_tokens: int,\n    mock_response: str = \"Hi! My name is Claude.\",\n    **kwargs,\n) -> AnthropicMessagesResponse:\n    \"\"\"\n    Mock response for Anthropic messages\n    \"\"\"\n    from litellm.exceptions import (\n        ContextWindowExceededError,\n        InternalServerError,\n        RateLimitError,\n    )\n\n    if mock_response == \"litellm.InternalServerError\":\n        raise InternalServerError(\n            message=\"this is a mock internal server error\",\n            llm_provider=\"anthropic\",\n            model=model,\n        )\n    elif mock_response == \"litellm.ContextWindowExceededError\":\n        raise ContextWindowExceededError(\n            message=\"this is a mock context window exceeded error\",\n            llm_provider=\"anthropic\",\n            model=model,\n        )\n    elif mock_response == \"litellm.RateLimitError\":\n        raise RateLimitError(\n            message=\"this is a mock rate limit error\",\n            llm_provider=\"anthropic\",\n            model=model,\n        )\n    return AnthropicMessagesResponse(\n        **{","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/messages/utils.py#L56-L92","documentation":"Error \"this is a mock internal server error\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/messages/utils.py:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is a test/mock error raised intentionally; remove the mock trigger from your request or test setup."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}