From 4b5cf08e7db0d327cbdc74f33c003d6b56d5064a Mon Sep 17 00:00:00 2001 From: Mario Montoya Date: Wed, 18 Sep 2024 15:55:02 -0500 Subject: [PATCH] Fixes showing server errors on `cli sql` calls (#1720) --- crates/cli/src/errors.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/errors.rs b/crates/cli/src/errors.rs index c2303f1de4f..4b7dd68d378 100644 --- a/crates/cli/src/errors.rs +++ b/crates/cli/src/errors.rs @@ -25,7 +25,8 @@ pub async fn error_for_status(response: Response) -> Result if let Some(kind) = status .is_client_error() .then_some(RequestSource::Client) - .or_else(|| status.is_client_error().then_some(RequestSource::Server)) + // Anything that is not a success is an error for the client, even a redirect that is not followed. + .or_else(|| (!status.is_success()).then_some(RequestSource::Server)) { let msg = response.text().await?; return Err(CliError::Request { kind, msg, status });