From 29aca5606778972aa8ac5a453cc525e39338ca1b Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 4 Sep 2023 13:10:30 -0400 Subject: [PATCH] adjust error message for when mobile confirmation fails (#311) - adjust error message for when mobile confirmation fails - update issue template --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- steamguard/src/confirmation.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 6caddbb..debd3ea 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -10,7 +10,7 @@ body: id: version attributes: label: Version - description: What version of steamguard-cli are you running? You can find this by running `steamguard --version`. + description: What version of steamguard-cli are you running? You can find this by running `steamguard --version`. **Do NOT just say "latest", or your issue will be automatically closed.** validations: required: true - type: textarea diff --git a/steamguard/src/confirmation.rs b/steamguard/src/confirmation.rs index 1c10461..c30e38f 100644 --- a/steamguard/src/confirmation.rs +++ b/steamguard/src/confirmation.rs @@ -109,7 +109,7 @@ where return Err(ConfirmerError::InvalidTokens); } if !body.success { - return Err(anyhow!("Server responded with failure.").into()); + return Err(ConfirmerError::RemoteFailure); } Ok(body.conf) } @@ -162,7 +162,7 @@ where return Err(ConfirmerError::InvalidTokens); } if !body.success { - return Err(anyhow!("Server responded with failure.").into()); + return Err(ConfirmerError::RemoteFailure); } Ok(()) @@ -237,7 +237,7 @@ where return Err(ConfirmerError::InvalidTokens); } if !body.success { - return Err(anyhow!("Server responded with failure.").into()); + return Err(ConfirmerError::RemoteFailure); } Ok(()) @@ -316,6 +316,8 @@ pub enum ConfirmerError { NetworkFailure(#[from] reqwest::Error), #[error("Failed to deserialize response: {0}")] DeserializeError(#[from] serde_path_to_error::Error), + #[error("Remote failure: Valve's server responded with a failure. This is likely not a steamguard-cli bug, Steam's confirmation API is just unreliable. Wait a bit and try again.")] + RemoteFailure, #[error("Unknown error: {0}")] Unknown(#[from] anyhow::Error), }