{"record":{"id":"e2aa2767a54872c0","repo":"BerriAI/litellm","slug":"azureexception-apierror-message","errorCode":null,"errorMessage":"AzureException APIError - {message}","messagePattern":"AzureException APIError - (.+?)","errorType":"exception","errorClass":"APIError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":2051,"sourceCode":"            )\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}\",\n                llm_provider=\"azure\",\n                litellm_debug_info=extra_information,\n                model=model,\n                request=httpx.Request(method=\"POST\", url=\"https://openai.com/\"),\n            )\n    else:\n        # if no status code then it is an APIConnectionError: https://github.com/openai/openai-python#handling-errors\n        raise APIConnectionError(\n            message=f\"{exception_provider} APIConnectionError - {message}\\n{_redact_string(traceback.format_exc())}\",\n            llm_provider=\"azure\",\n            model=model,\n            litellm_debug_info=extra_information,\n            request=httpx.Request(method=\"POST\", url=\"https://openai.com/\"),\n        )\n\n","sourceCodeStart":2033,"sourceCodeEnd":2069,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L2033-L2069","documentation":"Error \"AzureException APIError - {message}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:2051 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the Azure API error message; adjust request or retry."],"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"}