Skip to content

Commit

Permalink
Merge pull request #62 from DeterminateSystems/friendlier-error
Browse files Browse the repository at this point in the history
Friendlier error for file-not-found
  • Loading branch information
grahamc authored Oct 16, 2023
2 parents 37dbc50 + 7aaa44c commit d72db62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cli/cmd/status/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ pub(crate) async fn get_status_from_auth_file(
api_addr: url::Url,
) -> color_eyre::Result<TokenStatus> {
let auth_token_path = crate::cli::cmd::login::auth_token_path()?;
let token = tokio::fs::read_to_string(auth_token_path).await?;
let token = tokio::fs::read_to_string(&auth_token_path)
.await
.wrap_err_with(|| {
format!(
"Could not open {}; have you run `fh login`?",
auth_token_path.display()
)
})?;
let token = token.trim();

get_status_from_auth_token(api_addr, token).await
Expand Down

0 comments on commit d72db62

Please sign in to comment.