Skip to content

Commit d516f1a

Browse files
committed
docs: Clarify exception_id and parent_id parameters in
exceptions_from_error Add docstring details distinguishing mechanism.exception_id (sequential counter) from Python id() values used for cycle detection, and explaining parent_id's role in the event payload.
1 parent 90df082 commit d516f1a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sentry_sdk/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,22 @@ def exceptions_from_error(
828828
829829
See the Exception Interface documentation for more details:
830830
https://develop.sentry.dev/sdk/event-payloads/exception/
831+
832+
Args:
833+
exception_id (int):
834+
835+
Sequential counter for assigning ``mechanism.exception_id``
836+
to each processed exception. Is NOT the result of calling `id()` on the exception itself.
837+
838+
parent_id (int):
839+
840+
The ``mechanism.exception_id`` of the parent exception.
841+
842+
Written into ``mechanism.parent_id`` in the event payload so Sentry can
843+
reconstruct the exception tree.
844+
845+
Not to be confused with ``seen_exception_ids``, which tracks Python ``id()``
846+
values for cycle detection.
831847
"""
832848

833849
if seen_exception_ids is None:

0 commit comments

Comments
 (0)