Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sentry_sdk/integrations/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,8 @@ def _new_sync_chat_completion(f: "Any", *args: "Any", **kwargs: "Any") -> "Any":
except Exception as exc:
exc_info = sys.exc_info()
with capture_internal_exceptions():
_capture_exception(exc)
_capture_exception(exc, manual_span_cleanup=False)
span.__exit__(None, None, None)
reraise(*exc_info)

# Attribute check to fail gracefully if the attribute is not present in future `openai` versions.
Expand Down Expand Up @@ -776,7 +777,8 @@ async def _new_async_chat_completion(f: "Any", *args: "Any", **kwargs: "Any") ->
except Exception as exc:
exc_info = sys.exc_info()
with capture_internal_exceptions():
_capture_exception(exc)
_capture_exception(exc, manual_span_cleanup=False)
span.__exit__(None, None, None)
reraise(*exc_info)

# Attribute check to fail gracefully if the attribute is not present in future `openai` versions.
Expand Down
Loading