{"record":{"id":"9ee9abdca3e6b16e","repo":"BerriAI/litellm","slug":"ratelimiterror-exception-provider-message","errorCode":null,"errorMessage":"RateLimitError: {exception_provider} - {message}","messagePattern":"RateLimitError: (.+?) - (.+?)","errorType":"exception","errorClass":"RateLimitError","httpStatus":429,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":291,"sourceCode":"            message = str(original_exception)\n\n    if message is not None and isinstance(\n        message, str\n    ):  # done to prevent user-confusion. Relevant issue - https://github.com/BerriAI/litellm/issues/1414\n        message = message.replace(\"OPENAI\", custom_llm_provider.upper())\n        message = message.replace(\n            \"openai.OpenAIError\",\n            f\"{custom_llm_provider}.{custom_llm_provider}Error\",\n        )\n    if custom_llm_provider == \"openai\":\n        exception_provider = \"OpenAI\" + \"Exception\"\n    else:\n        exception_provider = custom_llm_provider[0].upper() + custom_llm_provider[1:] + \"Exception\"\n\n    if ExceptionCheckers.is_error_str_rate_limit(\n        error_str, status_code=getattr(original_exception, \"status_code\", None)\n    ):\n        raise RateLimitError(\n            message=f\"RateLimitError: {exception_provider} - {message}\",\n            model=model,\n            llm_provider=custom_llm_provider,\n            response=getattr(original_exception, \"response\", None),\n        )\n    elif ExceptionCheckers.is_error_str_context_window_exceeded(error_str):\n        raise ContextWindowExceededError(\n            message=f\"ContextWindowExceededError: {exception_provider} - {message}\",\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 \"invalid_request_error\" in error_str and \"model_not_found\" in error_str:\n        raise NotFoundError(\n            message=f\"{exception_provider} - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/exception_mapping_utils.py#L273-L309","documentation":"Exception-mapping branch: when the provider error string/status indicates a rate limit, the original provider exception is re-raised as a litellm RateLimitError with the provider name and original message embedded, normalizing 429-style errors across providers.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The provider rate-limited the request; retry with exponential backoff.","Reduce request rate, raise provider quotas, or configure router fallbacks to other deployments."],"exampleFix":null,"handlingStrategy":"retry","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"}