Skip to content

Commit 3179f6d

Browse files
authored
Fixes showing server errors on cli sql calls (#1720)
1 parent db29ded commit 3179f6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/cli/src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ pub async fn error_for_status(response: Response) -> Result<Response, CliError>
2525
if let Some(kind) = status
2626
.is_client_error()
2727
.then_some(RequestSource::Client)
28-
.or_else(|| status.is_client_error().then_some(RequestSource::Server))
28+
// Anything that is not a success is an error for the client, even a redirect that is not followed.
29+
.or_else(|| (!status.is_success()).then_some(RequestSource::Server))
2930
{
3031
let msg = response.text().await?;
3132
return Err(CliError::Request { kind, msg, status });

0 commit comments

Comments
 (0)