impl error::cause

This commit is contained in:
Matthew Scheirer 2017-09-17 18:59:06 -04:00
parent 6240163e5e
commit 50de2dacb3
1 changed files with 12 additions and 1 deletions

View File

@ -71,7 +71,18 @@ impl ErrorTrait for Error {
}
fn cause(&self) -> Option<&ErrorTrait> {
unimplemented!()
use Error::*;
match *self {
Jose(ref err) => Some(err),
Json(ref err) => Some(err),
Oauth(ref err) => Some(err),
Reqwest(ref err) => Some(err),
Decode(ref err) => None,
Validation(ref err) => None,
Userinfo(ref err) => None,
Insecure(_) => None,
MissingOpenidScope => None,
}
}
}