We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 022fef0 commit 83384fbCopy full SHA for 83384fb
1 file changed
src/unstructured_client/basesdk.py
@@ -313,11 +313,15 @@ async def cleanup_cancelled_request(
313
) -> None:
314
if req is None and response is None:
315
return
316
+ cleanup_request = req
317
+ if cleanup_request is None and response is not None:
318
+ cleanup_request = response.request
319
+ assert cleanup_request is not None
320
try:
321
await hooks.after_error_async(
322
AfterErrorContext(hook_ctx),
323
response,
- _RequestBoundCancelledError(req or response.request, cancellation),
324
+ _RequestBoundCancelledError(cleanup_request, cancellation),
325
)
326
except Exception:
327
logger.debug("Cancellation cleanup failed", exc_info=True)
0 commit comments