From 7383f5efb60fabdb797a71cc5288068b3095c294 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 8 May 2015 11:39:45 +0200 Subject: [PATCH] fix(hyper): update to hyper v0.4.0 * `hyper::HttpError` is now the more versatile `hyper::Error` --- src/device.rs | 4 ++-- src/helper.rs | 2 +- src/refresh.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/device.rs b/src/device.rs index ada40cad7..4277f714c 100644 --- a/src/device.rs +++ b/src/device.rs @@ -71,7 +71,7 @@ impl fmt::Display for PollInformation { /// Encapsulates all possible results of the `request_token(...)` operation pub enum RequestError { /// Indicates connection failure - HttpError(hyper::HttpError), + HttpError(hyper::Error), /// The OAuth client was not found InvalidClient, /// Some requested scopes were invalid. String contains the scopes as part of @@ -116,7 +116,7 @@ impl fmt::Display for RequestError { #[derive(Debug)] pub enum PollError { /// Connection failure - retry if you think it's worth it - HttpError(hyper::HttpError), + HttpError(hyper::Error), /// indicates we are expired, including the expiration date Expired(DateTime), /// Indicates that the user declined access. String is server response diff --git a/src/helper.rs b/src/helper.rs index 999e22d8b..29e606dc9 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -395,7 +395,7 @@ pub trait AuthenticatorDelegate { /// Called whenever there is an HttpError, usually if there are network problems. /// /// Return retry information. - fn connection_error(&mut self, &hyper::HttpError) -> Retry { + fn connection_error(&mut self, &hyper::Error) -> Retry { Retry::Abort } diff --git a/src/refresh.rs b/src/refresh.rs index 7b30847d5..1c79960df 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -24,7 +24,7 @@ pub struct RefreshFlow { /// All possible outcomes of the refresh flow pub enum RefreshResult { /// Indicates connection failure - Error(hyper::HttpError), + Error(hyper::Error), /// The server did not answer with a new token, providing the server message RefreshError(String, Option), /// The refresh operation finished successfully, providing a new `Token` @@ -37,7 +37,7 @@ impl RefreshFlow pub fn new(client: C) -> RefreshFlow { RefreshFlow { client: client, - result: RefreshResult::Error(hyper::HttpError::HttpStatusError), + result: RefreshResult::Error(hyper::Error::TooLarge), } }