Skip to content

Commit 7bad72a

Browse files
feat(sdk-crash): Keep more exception fields (#68680)
Keep non PII related fields: synthetic and errno with number and name.
1 parent 50742fe commit 7bad72a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

fixtures/sdk_crash_detection/crash_event_cocoa.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def get_crash_event_with_frames(
127127
"mechanism": {
128128
"handled": handled,
129129
"type": "mach",
130+
"synthetic": False,
130131
"meta": {
131132
"signal": {
132133
"number": 11,
@@ -140,6 +141,10 @@ def get_crash_event_with_frames(
140141
"subcode": 0,
141142
"name": "EXC_BAD_ACCESS",
142143
},
144+
"errno": {
145+
"number": 10,
146+
"name": "EACCES",
147+
},
143148
},
144149
},
145150
}

src/sentry/utils/sdk_crashes/event_stripper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def with_explanation(self, explanation: str) -> "Allow":
6161
"type": Allow.SIMPLE_TYPE,
6262
"mechanism": {
6363
"handled": Allow.SIMPLE_TYPE,
64+
"synthetic": Allow.SIMPLE_TYPE,
6465
"type": Allow.SIMPLE_TYPE,
6566
"meta": {
6667
"signal": {
@@ -75,6 +76,10 @@ def with_explanation(self, explanation: str) -> "Allow":
7576
"subcode": Allow.SIMPLE_TYPE,
7677
"name": Allow.SIMPLE_TYPE,
7778
},
79+
"errno": {
80+
"number": Allow.SIMPLE_TYPE,
81+
"name": Allow.SIMPLE_TYPE,
82+
},
7883
},
7984
},
8085
}

tests/sentry/utils/sdk_crashes/test_event_stripper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def test_strip_event_data_keeps_exception_mechanism(store_event, configs):
170170

171171
assert mechanism == {
172172
"handled": False,
173+
"synthetic": False,
173174
"type": "mach",
174175
"meta": {
175176
"signal": {"number": 11, "code": 0, "name": "SIGSEGV", "code_name": "SEGV_NOOP"},
@@ -179,6 +180,10 @@ def test_strip_event_data_keeps_exception_mechanism(store_event, configs):
179180
"subcode": 0,
180181
"name": "EXC_BAD_ACCESS",
181182
},
183+
"errno": {
184+
"number": 10,
185+
"name": "EACCES",
186+
},
182187
},
183188
}
184189

0 commit comments

Comments
 (0)