mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
Move the impls for PollError into error.rs
These should have been moved when error.rs was created but were missed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Module containing types related to delegates.
|
||||
|
||||
use crate::error::{PollError, RefreshError};
|
||||
use crate::error::{RefreshError};
|
||||
|
||||
use std::error::Error as StdError;
|
||||
use std::fmt;
|
||||
@@ -43,27 +43,6 @@ impl fmt::Display for PollInformation {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PollError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
match *self {
|
||||
PollError::HttpError(ref err) => err.fmt(f),
|
||||
PollError::Expired(ref date) => writeln!(f, "Authentication expired at {}", date),
|
||||
PollError::AccessDenied => "Access denied by user".fmt(f),
|
||||
PollError::TimedOut => "Timed out waiting for token".fmt(f),
|
||||
PollError::Other(ref s) => format!("Unknown server error: {}", s).fmt(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StdError for PollError {
|
||||
fn source(&self) -> Option<&(dyn StdError + 'static)> {
|
||||
match *self {
|
||||
PollError::HttpError(ref e) => Some(e),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A partially implemented trait to interact with the `Authenticator`
|
||||
///
|
||||
/// The only method that needs to be implemented manually is `present_user_code(...)`,
|
||||
|
||||
Reference in New Issue
Block a user