{"record":{"id":"f2c4419d6127db55","repo":"BerriAI/litellm","slug":"azureexception-serviceunavailableerror-message","errorCode":null,"errorMessage":"AzureException ServiceUnavailableError - {message}","messagePattern":"AzureException ServiceUnavailableError - (.+?)","errorType":"exception","errorClass":"ServiceUnavailableError","httpStatus":503,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":2035,"sourceCode":"            )\n        elif original_exception.status_code == 429:\n            raise RateLimitError(\n                message=f\"AzureException RateLimitError - {message}\",\n                model=model,\n                llm_provider=\"azure\",\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 502:\n            raise BadGatewayError(\n                message=f\"AzureException BadGatewayError - {message}\",\n                model=model,\n                llm_provider=\"azure\",\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 503:\n            raise ServiceUnavailableError(\n                message=f\"AzureException ServiceUnavailableError - {message}\",\n                model=model,\n                llm_provider=\"azure\",\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 504:  # gateway timeout error\n            raise Timeout(\n                message=f\"AzureException Timeout - {message}\",\n                model=model,\n                litellm_debug_info=extra_information,\n                llm_provider=\"azure\",\n                exception_status_code=original_exception.status_code,\n            )\n        else:\n            raise APIError(\n                status_code=original_exception.status_code,\n                message=f\"AzureException APIError - {message}\",","sourceCodeStart":2017,"sourceCodeEnd":2053,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/exception_mapping_utils.py#L2017-L2053","documentation":"Azure-specific status mapping: an upstream Azure exception with HTTP 502 is re-raised as BadGatewayError, signaling an infrastructure/gateway failure on Azure's side rather than a bad request.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:2035 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The Azure service is temporarily unavailable; retry with backoff.","Configure fallbacks to another deployment or region."],"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"}