Add yup-oauth2 error to auth error handling

This commit is contained in:
philippeitis
2022-09-24 12:13:30 -07:00
parent cac4666204
commit 7c045d7a25
2 changed files with 4 additions and 2 deletions

View File

@@ -26,6 +26,8 @@ path = "src/main.rs"
% endif
[dependencies]
## TODO: temporary, remove when yup-oauth2 is optional
anyhow = "^ 1.0"
hyper-rustls = "0.23.0"
## Must match the one hyper uses, otherwise there are duplicate similarly named `Mime` structs
mime = "^ 0.2.0"

View File

@@ -387,7 +387,7 @@ match result {
Error::HttpError(_)
|Error::Io(_)
|Error::MissingAPIKey
|Error::MissingToken
|Error::MissingToken(_)
|Error::Cancelled
|Error::UploadSizeLimitExceeded(_, _)
|Error::Failure(_)
@@ -710,7 +710,7 @@ else {
// TODO: remove Ok / Err branches
Ok(Some(token)) => token.clone(),
Ok(None) => {
let err = oauth2::OtherError("unknown error occurred while generating oauth2 token".into());
let err = oauth2::Error::OtherError(anyhow::Error::msg("unknown error occurred while generating oauth2 token"));
match dlg.token(&err) {
Some(token) => token,
None => {