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(
495495
496496 if errno is not None :
497497 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+ )
500501
501502 if client_options is None :
502503 with_locals = True
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ def inner(event):
8585 ).decode ("utf-8" )
8686 )
8787 _no_errors_in_semaphore_response (output )
88+ output .pop ("_meta" , None )
8889
8990 return inner
9091
Original file line number Diff line number Diff line change @@ -459,3 +459,18 @@ def __repr__(self):
459459 event ["exception" ]["values" ][0 ]["stacktrace" ]["frames" ][0 ]["vars" ]["a" ]
460460 == "<broken repr>"
461461 )
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