File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
hybridcloud/apigateway_async Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1212import httpx
1313from asgiref .sync import sync_to_async
1414from django .conf import settings
15- from django .core .exceptions import RequestAborted
1615from django .http import HttpRequest , HttpResponse , JsonResponse , StreamingHttpResponse
1716from django .http .response import HttpResponseBase
1817
@@ -199,7 +198,7 @@ async def proxy_cell_request(
199198 return _adapt_response (resp , target_url )
200199 except asyncio .CancelledError :
201200 metrics .incr ("apigateway.proxy.request_aborted" , tags = metric_tags )
202- raise RequestAborted ()
201+ raise
203202 except httpx .TimeoutException :
204203 metrics .incr ("apigateway.proxy.request_timeout" , tags = metric_tags )
205204 circuitbreaker .incr_failures ()
Original file line number Diff line number Diff line change @@ -255,7 +255,10 @@ def before_send(event: Event, hint: Hint) -> Event | None:
255255 if settings .SENTRY_LOCAL_CELL :
256256 event ["tags" ]["sentry_region" ] = settings .SENTRY_LOCAL_CELL
257257
258- if hint .get ("exc_info" , [None ])[0 ] == OperationalError :
258+ event_exc : type [BaseException ] | None = hint .get ("exc_info" , [None ])[0 ]
259+ if event_exc == asyncio .CancelledError :
260+ return None
261+ if event_exc == OperationalError :
259262 event ["level" ] = "warning"
260263
261264 return event
You can’t perform that action at this time.
0 commit comments