{"record":{"id":"d1284a4d739c97bc","repo":"BerriAI/litellm","slug":"serviceunavailableerror-exception-provider-m","errorCode":null,"errorMessage":"ServiceUnavailableError: {exception_provider} - {message}","messagePattern":"ServiceUnavailableError: (.+?) - (.+?)","errorType":"exception","errorClass":"ServiceUnavailableError","httpStatus":503,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":465,"sourceCode":"            )\n        elif original_exception.status_code == 500:\n            raise InternalServerError(\n                message=f\"InternalServerError: {exception_provider} - {message}\",\n                model=model,\n                llm_provider=custom_llm_provider,\n                response=getattr(original_exception, \"response\", None),\n                litellm_debug_info=extra_information,\n            )\n        elif original_exception.status_code == 502:\n            raise BadGatewayError(\n                message=f\"BadGatewayError: {exception_provider} - {message}\",\n                model=model,\n                llm_provider=custom_llm_provider,\n                response=getattr(original_exception, \"response\", None),\n                litellm_debug_info=extra_information,\n            )\n        elif original_exception.status_code == 503:\n            raise ServiceUnavailableError(\n                message=f\"ServiceUnavailableError: {exception_provider} - {message}\",\n                model=model,\n                llm_provider=custom_llm_provider,\n                response=getattr(original_exception, \"response\", None),\n                litellm_debug_info=extra_information,\n            )\n        elif original_exception.status_code == 504:  # gateway timeout error\n            raise Timeout(\n                message=f\"Timeout Error: {exception_provider} - {message}\",\n                model=model,\n                llm_provider=custom_llm_provider,\n                litellm_debug_info=extra_information,\n                exception_status_code=original_exception.status_code,\n            )\n        else:\n            raise APIError(\n                status_code=original_exception.status_code,\n                message=f\"APIError: {exception_provider} - {message}\",","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/exception_mapping_utils.py#L447-L483","documentation":"Generic provider status-code mapping: an upstream exception with HTTP 503 is re-raised as LiteLLM's ServiceUnavailableError, signaling the provider is temporarily unavailable.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:465 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The provider is temporarily unavailable; retry with exponential backoff.","Configure router fallbacks to another provider/deployment for resilience."],"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-23T08:17:48.524Z"}