diff --git a/src/generator/templates/Cargo.toml.mako b/src/generator/templates/Cargo.toml.mako index 97e0c72b21..7885c43435 100644 --- a/src/generator/templates/Cargo.toml.mako +++ b/src/generator/templates/Cargo.toml.mako @@ -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" diff --git a/src/generator/templates/api/lib/mbuild.mako b/src/generator/templates/api/lib/mbuild.mako index a3f5d4b5cc..7ba7c06a75 100644 --- a/src/generator/templates/api/lib/mbuild.mako +++ b/src/generator/templates/api/lib/mbuild.mako @@ -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 => {