mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-06 03:22:42 +01:00
Add yup-oauth2 error to auth error handling
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user