{"record":{"id":"9c945aca8c9954be","repo":"BerriAI/litellm","slug":"azureexception-badgatewayerror-message","errorCode":null,"errorMessage":"AzureException BadGatewayError - {message}","messagePattern":"AzureException BadGatewayError - (.+?)","errorType":"exception","errorClass":"BadGatewayError","httpStatus":502,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":2027,"sourceCode":"            )\n        elif original_exception.status_code == 422:\n            raise BadRequestError(\n                message=f\"AzureException BadRequestError - {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 == 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,","sourceCodeStart":2009,"sourceCodeEnd":2045,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L2009-L2045","documentation":"Error \"AzureException BadGatewayError - {message}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:2027 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Azure gateway error; retry with backoff and check Azure status."],"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-15T17:31:12.345Z"}