Commit 5f9c506
fix: handle axios errors in Turnstile service to prevent misleading 500 responses (#1601)
Unhandled axios errors from Cloudflare API were propagating as 500 Internal Server Error
with confusing message "Request failed with status code 400". Now catches these errors
and returns a proper 400 BadRequest with a clear message.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3e5434f commit 5f9c506
1 file changed
Lines changed: 15 additions & 9 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
0 commit comments