{"record":{"id":"7463cbbdcffeeb2a","repo":"BerriAI/litellm","slug":"exception-provider-error-str","errorCode":null,"errorMessage":"{exception_provider} - {error_str}","messagePattern":"\\{exception_provider\\} - \\{error_str\\}","errorType":"exception","errorClass":"BadRequestError","httpStatus":400,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":2082,"sourceCode":"            model=model,\n            litellm_debug_info=extra_information,\n            request=httpx.Request(method=\"POST\", url=\"https://openai.com/\"),\n        )\n\n\ndef _map_openrouter_exception(\n    *,\n    model: str,\n    original_exception: _ProviderHTTPException,\n    custom_llm_provider: str,\n    error_str: str,\n    exception_type: str,\n    exception_provider: str,\n    extra_information: str,\n) -> None:\n    if hasattr(original_exception, \"status_code\"):\n        if original_exception.status_code == 400:\n            raise BadRequestError(\n                message=f\"{exception_provider} - {error_str}\",\n                llm_provider=custom_llm_provider,\n                model=model,\n                response=getattr(original_exception, \"response\", None),\n                litellm_debug_info=extra_information,\n            )\n        elif original_exception.status_code == 401:\n            raise AuthenticationError(\n                message=f\"AuthenticationError: {exception_provider} - {error_str}\",\n                llm_provider=custom_llm_provider,\n                model=model,\n                response=getattr(original_exception, \"response\", None),\n                litellm_debug_info=extra_information,\n            )\n        elif original_exception.status_code == 404:\n            raise NotFoundError(\n                message=f\"NotFoundError: {exception_provider} - {error_str}\",\n                model=model,","sourceCodeStart":2064,"sourceCodeEnd":2100,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L2064-L2100","documentation":"Error \"{exception_provider} - {error_str}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:2082 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the provider error string and adjust the request or credentials."],"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"}