{"record":{"id":"e2474c8064f7284c","repo":"BerriAI/litellm","slug":"exception-provider-apiconnectionerror-message","errorCode":null,"errorMessage":"{exception_provider} APIConnectionError - {message}","messagePattern":"(.+?) APIConnectionError - (.+?)","errorType":"exception","errorClass":"APIConnectionError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":1971,"sourceCode":"    elif \"invalid_request_error\" in error_str and getattr(original_exception, \"status_code\", None) in (None, 400):\n        raise BadRequestError(\n            message=f\"AzureException BadRequestError - {message}\",\n            llm_provider=\"azure\",\n            model=model,\n            litellm_debug_info=extra_information,\n            response=getattr(original_exception, \"response\", None),\n            body=getattr(original_exception, \"body\", None),\n        )\n    elif \"The api_key client option must be set either by passing api_key to the client or by setting\" in error_str:\n        raise AuthenticationError(\n            message=f\"{exception_provider} AuthenticationError - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            litellm_debug_info=extra_information,\n            response=getattr(original_exception, \"response\", None),\n        )\n    elif \"Connection error\" in error_str:\n        raise APIConnectionError(\n            message=f\"{exception_provider} APIConnectionError - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            litellm_debug_info=extra_information,\n        )\n    elif hasattr(original_exception, \"status_code\"):\n        if original_exception.status_code == 400:\n            raise BadRequestError(\n                message=f\"AzureException - {message}\",\n                llm_provider=\"azure\",\n                model=model,\n                litellm_debug_info=extra_information,\n                response=getattr(original_exception, \"response\", None),\n                body=getattr(original_exception, \"body\", None),\n            )\n        elif original_exception.status_code == 401:\n            raise AuthenticationError(\n                message=f\"AzureException AuthenticationError - {message}\",","sourceCodeStart":1953,"sourceCodeEnd":1989,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L1953-L1989","documentation":"Error \"{exception_provider} APIConnectionError - {message}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:1971 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity and api_base for the provider."],"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-15T22:17:37.221Z"}