Commit 40299af
authored
fix(feedback): parse JSON after checking status code (#103167)
fixes a bunch of noisy `JSONDecodeErrors` in title gen, label gen, and
spam detection that were happening because we tried to JSON decode 500
responses:
https://sentry.sentry.io/issues/6977994202/?query=%22jsondecodeerror%22&referrer=issue-stream
https://sentry.sentry.io/issues/6978011530/?query=%22jsondecodeerror%22&referrer=issue-stream
https://sentry.sentry.io/issues/6978011522/?query=%22jsondecodeerror%22&referrer=issue-stream
https://sentry.sentry.io/issues/6978011504/?query=%22jsondecodeerror%22&referrer=issue-stream
`response.json()` calls are now outside try/catch which SHOULD be safe
because by the time we get here, the status code is 200. This pattern
matches what's currently in
[`organization_feedback_summary.py`](https://github.com/getsentry/sentry/blob/b91b6e10dd3812b081ca3b317b8923bca709e796/src/sentry/feedback/endpoints/organization_feedback_summary.py#L64).1 parent 49b7c13 commit 40299af
File tree
4 files changed
+4
-9
lines changed- src/sentry/feedback
- endpoints
- usecases
4 files changed
+4
-9
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
| |||
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
236 | | - | |
| 235 | + | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | | - | |
63 | 60 | | |
64 | | - | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
| 95 | + | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
0 commit comments