Skip to content

Commit

Permalink
Fixes showing server errors on cli sql calls (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamcx authored Sep 18, 2024
1 parent db29ded commit 3179f6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/cli/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pub async fn error_for_status(response: Response) -> Result<Response, CliError>
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 });
Expand Down

2 comments on commit 3179f6d

@github-actions
Copy link

@github-actions github-actions bot commented on 3179f6d Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarking failed. Please check the workflow run for details.

@github-actions
Copy link

@github-actions github-actions bot commented on 3179f6d Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarking failed. Please check the workflow run for details.

Please sign in to comment.