add some more logging in phoneajax

This commit is contained in:
Carson McManus 2021-08-09 20:11:15 -04:00
parent b2414e0c33
commit bb762b2f47
2 changed files with 5 additions and 4 deletions

View file

@ -142,7 +142,7 @@ fn main() {
return;
}
Err(AccountLinkError::MustProvidePhoneNumber) => {
print!("Enter your phone number:");
print!("Enter your phone number: ");
linker.phone_number = prompt();
}
Err(AccountLinkError::AuthenticatorPresent) => {

View file

@ -315,18 +315,19 @@ impl SteamApiClient {
.send()?;
let result: Value = resp.json()?;
trace!("phoneajax: {:?}", result);
if result["has_phone"] != Value::Null {
trace!("found has_phone field");
trace!("op: {} - found has_phone field", op);
return result["has_phone"]
.as_bool()
.ok_or(anyhow!("failed to parse has_phone field into boolean"));
} else if result["success"] != Value::Null {
trace!("found success field");
trace!("op: {} - found success field", op);
return result["success"]
.as_bool()
.ok_or(anyhow!("failed to parse success field into boolean"));
} else {
trace!("did not find any expected field");
trace!("op: {} - did not find any expected field", op);
return Ok(false);
}
}