Skip to content

Commit 5d9e0d0

Browse files
more capture_exception to outer layer
1 parent b3e5d01 commit 5d9e0d0

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

sentry_sdk/integrations/openai_agents/patches/agent_run.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ async def patched_run_single_turn(cls, *args, **kwargs):
9393
try:
9494
result = await original_run_single_turn(*args, **kwargs)
9595
except Exception as exc:
96-
_capture_exception(exc)
97-
9896
if span is not None and span.timestamp is None:
9997
_record_exception_on_span(span, exc)
10098
end_invoke_agent_span(context_wrapper, agent)

sentry_sdk/integrations/openai_agents/patches/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async def wrapper(*args, **kwargs):
3939
try:
4040
run_result = await original_func(*args, **kwargs)
4141
except _SingleTurnException as exc:
42-
# Handled in _run_single_turn() patch.
42+
_capture_exception(exc.original)
4343
raise exc.original from None
4444
except AgentsException as exc:
4545
_capture_exception(exc)

0 commit comments

Comments
 (0)