Commit 14375df
Handle 404 errors gracefully in AvatarsController (#8346)
When a user's avatar_url points to a dead link, the open-uri fetch
raises OpenURI::HTTPError. Previously this was caught by the broad
StandardError rescue, reported to Bugsnag (noise), and returned a 500.
Now we specifically rescue OpenURI::HTTPError and fall back to serving
the placeholder avatar with a short cache TTL (5 minutes), so users
still see an avatar and the error doesn't flood Bugsnag.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4180fea commit 14375df
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
0 commit comments