Skip to content

Commit e07601c

Browse files
committed
Updated some tests
1 parent 1af0708 commit e07601c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sentry_sdk/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ def single_exception_from_error_tuple(
672672
is_root_exception = exception_id == 0
673673
if not is_root_exception and parent_id is not None:
674674
exception_value["mechanism"]["parent_id"] = parent_id
675-
exception_value["mechanism"]["type"] = "chained"
675+
if "type" not in exception_value["mechanism"]:
676+
exception_value["mechanism"]["type"] = "chained"
676677

677678
if is_root_exception and "type" not in exception_value["mechanism"]:
678679
exception_value["mechanism"]["type"] = "generic"

tests/test_exceptiongroup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def test_exception_chain_context():
258258
"mechanism": {
259259
"handled": False,
260260
"type": "test_suite",
261+
"exception_id": 1,
261262
},
262263
"module": None,
263264
"type": "TypeError",
@@ -267,6 +268,7 @@ def test_exception_chain_context():
267268
"mechanism": {
268269
"handled": False,
269270
"type": "test_suite",
271+
"exception_id": 0,
270272
},
271273
"module": None,
272274
"type": "ValueError",
@@ -297,6 +299,7 @@ def test_simple_exception():
297299
"mechanism": {
298300
"handled": False,
299301
"type": "test_suite",
302+
"exception_id": 0,
300303
},
301304
"module": None,
302305
"type": "ValueError",

0 commit comments

Comments
 (0)