Commit 936f24c
fix: don't report click.Abort/ClickException to Sentry (#1039)
## Summary
- `click.Abort`, `click.exceptions.Exit`, and `click.ClickException` are
raised on purpose to display user-facing messages (Ctrl+C, declined
prompts, missing dependencies, etc.). They are not crashes and shouldn't
generate Sentry issues.
- This PR adds a small `_is_user_error` filter at the top of
`capture_exception` so they short-circuit before any Sentry init/flush.
## Closes
- [FLYTE-SDK-H](https://unionai.sentry.io/issues/FLYTE-SDK-H) — `Abort`
from `click.confirm`
- [FLYTE-SDK-G](https://unionai.sentry.io/issues/FLYTE-SDK-G) — Docker
daemon not reachable
- [FLYTE-SDK-J](https://unionai.sentry.io/issues/FLYTE-SDK-J) — Timed
out waiting for Flyte cluster
- [FLYTE-SDK-W](https://unionai.sentry.io/issues/FLYTE-SDK-W) — Timed
out waiting for kubeconfig
- [FLYTE-SDK-Q](https://unionai.sentry.io/issues/FLYTE-SDK-Q) — Failed
to pull image
- [FLYTE-SDK-5](https://unionai.sentry.io/issues/FLYTE-SDK-5) — Failed
to start container
## Test plan
- [x] New unit tests in tests/flyte/test_sentry.py cover the filter
(Abort/Exit/ClickException) and verify real errors still report.
- [ ] Smoke test \`flyte start devbox\` locally with no docker running —
should print the friendly message and not bump Sentry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 660805a commit 936f24c
2 files changed
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
| 77 | + | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments