Skip to content

Commit 5f1db51

Browse files
committed
Fix infinite recursion with errors
1 parent b53f627 commit 5f1db51

File tree

1 file changed

+3
-1
lines changed
  • pydantic_graph/pydantic_graph/beta

1 file changed

+3
-1
lines changed

pydantic_graph/pydantic_graph/beta/graph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,4 +897,6 @@ def _unwrap_exception_groups():
897897
try:
898898
yield
899899
except ExceptionGroup as e:
900-
raise e.exceptions[0]
900+
exception = e.exceptions[0]
901+
exception.__cause__ = None # prevent recursion errors when formatting the exception for logfire
902+
raise exception

0 commit comments

Comments
 (0)