Skip to content

Commit

Permalink
Better error in case of 401 Unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-h committed Oct 16, 2023
1 parent dc9256a commit 6e56409
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli/cmd/status/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ pub(crate) async fn get_status_from_auth_token(
.send()
.await
.wrap_err("Failed to send request")?;

if res.status() == 401 {
return Err(color_eyre::eyre::eyre!(
"The provided token was invalid. Please try again, or contact [email protected] if the problem persists."
));
}

let res = res
.error_for_status()
.wrap_err("Request was unsuccessful")?;
Expand Down

0 comments on commit 6e56409

Please sign in to comment.