Repository navigation
Commit 2fc50ad
committed
fix(errors): never print a blank error for an empty response body
Under heavy load a small fraction of requests (~0.02-0.06%) failed with
an error line that was nothing but ANSI color codes: a dropped
connection or bodyless 5xx produced an empty body, api_error() echoed
it verbatim, and print paths rendered red("") — invisible output with
exit 1.
- util::api_error: empty/whitespace body now falls back to 'unexpected
empty response from server' (covers every caller, including the
direct api_error(...).red() prints in databases.rs).
- sdk::format_fail_message: when the body is empty the HTTP status is
the only signal there is, so surface it: 'error: HTTP 502 Bad Gateway
(empty response body)'.1 parent b231f85 commit 2fc50ad
2 files changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
897 | 902 | | |
898 | 903 | | |
899 | 904 | | |
| |||
973 | 978 | | |
974 | 979 | | |
975 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
976 | 993 | | |
977 | 994 | | |
978 | 995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| |||
459 | 464 | | |
460 | 465 | | |
461 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
462 | 481 | | |
463 | 482 | | |
464 | 483 | | |
| |||
0 commit comments