uranusjr commented on code in PR #76826:
URL: https://github.com/apache/airflow/pull/76826#discussion_r4687859990


##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -198,14 +198,15 @@ def getuser() -> str:
 
 def get_json_error(response: httpx2.Response):
     """Raise a ServerResponseError if we can extract error info from the 
error."""
-    err = ServerResponseError.from_response(response)
-    if err:
+    if err := ServerResponseError.from_response(response):
         raise err
 
 
 def raise_on_4xx_5xx(response: httpx2.Response):
     try:
-        return get_json_error(response) or response.raise_for_status()
+        get_json_error(response)
+        if not response.is_redirect:  # Followed by httpx, or handled by the 
caller.

Review Comment:
   Done differently. The hook is back to raising for every non-2xx (also 
renamed to `require_2xx` to reflect its actual behavior), and only Get XCom 
catches the error and follows a redirect to its own slice.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to