Skip to content

Commit 05ba2df

Browse files
committed
Fix for agent cancel error
1 parent ff8f18d commit 05ba2df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ddtrace/contrib/internal/openai/patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import os
23
import sys
34
from typing import Dict
@@ -296,7 +297,7 @@ async def patched_endpoint(openai, pin, func, instance, args, kwargs):
296297
try:
297298
resp = await func(*args, **kwargs)
298299
return resp
299-
except Exception as e:
300+
except (Exception, asyncio.CancelledError) as e:
300301
err = e
301302
raise
302303
finally:

0 commit comments

Comments
 (0)