Commit 9dcab47
committed
Skip Sentry capture when token refresh fails with 401
When a token refresh fails with UnauthorizedError (401), this is an
expected re-authentication flow — the refresh token is expired, revoked,
or lacks required OAuth scopes. The app correctly logs out the user,
but was also capturing this to Sentry, generating thousands of noise
events (2.6k spike on April 19 after a scope change).
Mirror the pattern already used in fetchCreatorStatus: console.warn
for UnauthorizedError, Sentry.captureException only for unexpected
errors.
Fixes GUMROAD-MOBILE-2D1 parent ba0a1af commit 9dcab47
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
119 | 131 | | |
120 | 132 | | |
121 | 133 | | |
| |||
0 commit comments