File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,9 @@ def single_exception_from_error_tuple(
495
495
496
496
if errno is not None :
497
497
mechanism = mechanism or {}
498
- mechanism_meta = mechanism .setdefault ("meta" , {})
499
- mechanism_meta .setdefault ("errno" , {"code" : errno })
498
+ mechanism .setdefault ("meta" , {}).setdefault ("errno" , {}).setdefault (
499
+ "number" , errno
500
+ )
500
501
501
502
if client_options is None :
502
503
with_locals = True
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ def inner(event):
85
85
).decode ("utf-8" )
86
86
)
87
87
_no_errors_in_semaphore_response (output )
88
+ output .pop ("_meta" , None )
88
89
89
90
return inner
90
91
Original file line number Diff line number Diff line change @@ -459,3 +459,18 @@ def __repr__(self):
459
459
event ["exception" ]["values" ][0 ]["stacktrace" ]["frames" ][0 ]["vars" ]["a" ]
460
460
== "<broken repr>"
461
461
)
462
+
463
+
464
+ def test_errno_errors (sentry_init , capture_events ):
465
+ sentry_init ()
466
+ events = capture_events ()
467
+
468
+ class Foo (Exception ):
469
+ errno = 69
470
+
471
+ capture_exception (Foo ())
472
+
473
+ event , = events
474
+
475
+ exception , = event ["exception" ]["values" ]
476
+ assert exception ["mechanism" ]["meta" ]["errno" ]["number" ] == 69
You can’t perform that action at this time.
0 commit comments