Skip to content

Commit a5ae6a7

Browse files
auvipyCopilot
andauthored
Update kombu/asynchronous/http/urllib3_client.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e83685f commit a5ae6a7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

kombu/asynchronous/http/urllib3_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,18 @@ def _execute_request(self, request):
180180
effective_url=response.geturl() if hasattr(response, 'geturl') else request.url,
181181
error=None
182182
)
183-
response.release_conn()
183+
except urllib3.exceptions.HTTPError as e:
184+
# Handle HTTPError specifically
185+
response_obj = self.Response(
186+
request=request,
187+
code=599,
188+
headers={},
189+
buffer=None,
190+
effective_url=None,
191+
error=HttpError(599, str(e))
192+
)
184193
except Exception as e:
185-
# Handle any errors
194+
# Handle any other errors
186195
response_obj = self.Response(
187196
request=request,
188197
code=599,

0 commit comments

Comments
 (0)