Skip to content

Commit d4022ba

Browse files
fix(pydantic-ai): Stop capturing internal exceptions
1 parent eedd101 commit d4022ba

File tree

1 file changed

+9
-16
lines changed
  • sentry_sdk/integrations/pydantic_ai/patches

1 file changed

+9
-16
lines changed

sentry_sdk/integrations/pydantic_ai/patches/tools.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import sentry_sdk
55

66
from ..spans import execute_tool_span, update_execute_tool_span
7-
from ..utils import (
8-
_capture_exception,
9-
get_current_agent,
10-
)
7+
from ..utils import get_current_agent
118

129
from typing import TYPE_CHECKING
1310

@@ -73,18 +70,14 @@ async def wrapped_call_tool(
7370
agent,
7471
tool_type=tool_type,
7572
) as span:
76-
try:
77-
result = await original_call_tool(
78-
self,
79-
call,
80-
*args,
81-
**kwargs,
82-
)
83-
update_execute_tool_span(span, result)
84-
return result
85-
except Exception as exc:
86-
_capture_exception(exc)
87-
raise exc from None
73+
result = await original_call_tool(
74+
self,
75+
call,
76+
*args,
77+
**kwargs,
78+
)
79+
update_execute_tool_span(span, result)
80+
return result
8881

8982
# No span context - just call original
9083
return await original_call_tool(

0 commit comments

Comments
 (0)