diff --git a/src/imp/openssl.rs b/src/imp/openssl.rs index cc83f2e6..9dfc4b74 100644 --- a/src/imp/openssl.rs +++ b/src/imp/openssl.rs @@ -127,10 +127,10 @@ impl error::Error for Error { } } - fn cause(&self) -> Option<&error::Error> { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { match *self { - Error::Normal(ref e) => error::Error::cause(e), - Error::Ssl(ref e, _) => error::Error::cause(e), + Error::Normal(ref e) => Some(e), + Error::Ssl(ref e, _) => Some(e), } } } diff --git a/src/lib.rs b/src/lib.rs index 34f3fa0a..e1902466 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -136,9 +136,13 @@ impl error::Error for Error { error::Error::description(&self.0) } - fn cause(&self) -> Option<&error::Error> { + fn cause(&self) -> Option<&dyn error::Error> { error::Error::cause(&self.0) } + + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + error::Error::source(&self.0) + } } impl fmt::Display for Error {