diff options
author | doug tangren <d.tangren@gmail.com> | 2018-12-24 13:45:15 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-24 13:45:15 +0900 |
commit | 7d5672fbe1089ef5b02375f7f3f77fe5257e4ec5 (patch) | |
tree | 15f72b04754901237ad666da6fa100d52af515c0 /src | |
parent | 6fedc6580341543173cae5641427825459d794e3 (diff) |
fill in error details (#142)
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index f363ffd..3c9e459 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -67,7 +67,16 @@ impl fmt::Display for Error { impl StdError for Error { fn description(&self) -> &str { - "Shiplift Error" + match self { + Error::SerdeJsonError(e) => e.description(), + Error::Hyper(e) => e.description(), + Error::Http(e) => e.description(), + Error::IO(e) => e.description(), + Error::Encoding(e) => e.description(), + Error::InvalidResponse(msg) => msg.as_str(), + Error::Fault { message, .. } => message.as_str(), + Error::ConnectionNotUpgraded => "connection not upgraded", + } } fn cause(&self) -> Option<&StdError> { @@ -75,6 +84,7 @@ impl StdError for Error { Error::SerdeJsonError(ref err) => Some(err), Error::Http(ref err) => Some(err), Error::IO(ref err) => Some(err), + Error::Encoding(e) => Some(e), _ => None, } } |