Commit bcb9beb
authored
## Summary
- **Exclude `OutputError` from `Sentry.captureException()`** in
`withTelemetry`'s outer catch block. `OutputError` is an intentional
non-zero exit mechanism (e.g., `sentry api` got a 4xx/5xx response), not
a CLI bug. This eliminates ~1,335 noise events across 160 users
([CLI-PK](https://sentry.sentry.io/issues/7367976863/)).
- **Add structured `api_error.*` span attributes** (`status`,
`endpoint`, `method`) on the active telemetry span before throwing
`OutputError` in the `sentry api` command, preserving Discover
queryability for API error rates.
- **Add tests** verifying `OutputError` is not captured as a Sentry
exception.
## Changes
| File | Change |
|------|--------|
| `src/lib/telemetry.ts` | Add `OutputError` to exclusion check
alongside `AuthError` and client `ApiError` |
| `src/commands/api.ts` | Add `recordApiErrorAttributes()` helper;
record span attributes on 4xx/5xx |
| `test/lib/telemetry.test.ts` | Add 2 tests for `OutputError` exclusion
(null data + object data) |
Fixes CLI-PK
1 parent 42c6e5e commit bcb9beb
3 files changed
+67
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
1036 | 1038 | | |
1037 | 1039 | | |
1038 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1039 | 1063 | | |
1040 | 1064 | | |
1041 | 1065 | | |
| |||
1217 | 1241 | | |
1218 | 1242 | | |
1219 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1220 | 1255 | | |
1221 | 1256 | | |
1222 | 1257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | 236 | | |
213 | 237 | | |
| |||
0 commit comments