Skip to content

Commit

Permalink
Fixes showing server errors on sql calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mamcx committed Sep 18, 2024
1 parent 14e5098 commit 9136d63
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

0 comments on commit 9136d63

Please sign in to comment.