@@ -1411,6 +1411,8 @@ class RateLimitError(Exception):
14111411 (Exception ("TLS certificate verify failed" ), "network_error" , "tls_error" ),
14121412 (Exception ("Connection refused" ), "network_error" , "connection_refused" ),
14131413 (Exception ("connection request was blocked by firewall" ), "network_error" , "network_error" ),
1414+ (Exception ("connection blocked by policy" ), "network_error" , "network_error" ),
1415+ (Exception ("request blocked by firewall" ), "network_error" , "network_error" ),
14141416 (Exception ("blocked" ), "network_error" , "unknown_error" ),
14151417 (Exception ("model gpt-4o is not authorized for this account" ), "model_not_found" , "model_access_denied" ),
14161418 (Exception ("litellm.APIError: APIError: OpenAIException - Model disabled." ), "model_not_found" , "model_access_denied" ),
@@ -1512,6 +1514,8 @@ def test_discover_llm_channel_models_classifies_error_scenarios(self, mock_get)
15121514 rate_limit_response .json .return_value = {"error" : {"message" : "too many requests" }}
15131515 blocked_response = Mock (ok = False , status_code = 403 , text = "Forbidden: your request was blocked by content policy" )
15141516 blocked_response .json .return_value = {"error" : {"message" : "Forbidden: your request was blocked by content policy" }}
1517+ connection_blocked_response = Mock (ok = False , status_code = 403 , text = "connection blocked by policy" )
1518+ connection_blocked_response .json .return_value = {"error" : {"message" : "connection blocked by policy" }}
15151519 invalid_json_response = Mock (ok = True , status_code = 200 , text = "<html>bad gateway</html>" )
15161520 invalid_json_response .json .side_effect = ValueError ("invalid json" )
15171521
@@ -1524,6 +1528,7 @@ def test_discover_llm_channel_models_classifies_error_scenarios(self, mock_get)
15241528 (quota_blocked_response , "quota" , "model_discovery" , True , "insufficient_balance" ),
15251529 (rate_limit_response , "quota" , "model_discovery" , True , "rate_limit" ),
15261530 (blocked_response , "request_blocked" , "model_discovery" , False , "provider_blocked" ),
1531+ (connection_blocked_response , "network_error" , "model_discovery" , True , "network_error" ),
15271532 (invalid_json_response , "format_error" , "response_parse" , False , "non_json" ),
15281533 ]:
15291534 with self .subTest (error_code = error_code ):
0 commit comments