@@ -16,9 +16,9 @@ class HttpRequestErrorType(IntEnum):
1616 an HTTP status code.
1717
1818 Example:
19- if error_code == RequestErrorType .BAD_REQUEST:
19+ if error_code == HttpRequestErrorType .BAD_REQUEST:
2020 print("Bad request from server!")
21- elif error_code == RequestErrorType .TIMEOUT_ERROR:
21+ elif error_code == HttpRequestErrorType .TIMEOUT_ERROR:
2222 print("Client-side request timed out!")
2323 """
2424
@@ -86,7 +86,7 @@ def __post_init__(self):
8686 default_messages = {
8787 HttpRequestErrorType .UNKNOWN_ERROR : f"An unknown error { self .exception } occurred, Traceback: { traceback .format_exc ()} " ,
8888 HttpRequestErrorType .TIMEOUT_ERROR : "The request timed out." ,
89- HttpRequestErrorType .REQUEST_ERROR : f"A network request error occurred occurred . TypeError: { type (self .exception )} " ,
89+ HttpRequestErrorType .REQUEST_ERROR : f"A network request error occurred. TypeError: { type (self .exception )} " ,
9090 HttpRequestErrorType .BAD_REQUEST : f"Bad Request (400): The server could not process the request { self .payload } " ,
9191 HttpRequestErrorType .UNAUTHORIZED : "Unauthorized (401): Authentication failed or is required." ,
9292 HttpRequestErrorType .FORBIDDEN : "Forbidden (403): Access is denied." ,
@@ -139,4 +139,6 @@ def set_rollout_response_status(http_result: HttpRequestResult, response: RLRoll
139139 elif http_result .is_server_error :
140140 response .finish_reason = "failed"
141141 if server_url :
142- response .extra_info = {"url" : server_url }
142+ if response .extra_info is None :
143+ response .extra_info = {}
144+ response .extra_info .update ({"url" : server_url })
0 commit comments