diff options
| author | Benjamin Cheng <[email protected]> | 2018-06-02 10:56:31 -0400 |
|---|---|---|
| committer | Benjamin Cheng <[email protected]> | 2018-06-02 10:56:31 -0400 |
| commit | b1eb1224f50b6242f82cdeca7a876409c98e1d3a (patch) | |
| tree | 4aad295a6847fb1bd2d54880cf5bcd4b7ec522f5 /openssl/src/ssl/error.rs | |
| parent | Add wrapper for SSL_CTX_set_psk_server_callback (diff) | |
| parent | Merge pull request #940 from CmdrMoozy/rsa_padding (diff) | |
| download | rust-openssl-b1eb1224f50b6242f82cdeca7a876409c98e1d3a.tar.xz rust-openssl-b1eb1224f50b6242f82cdeca7a876409c98e1d3a.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'openssl/src/ssl/error.rs')
| -rw-r--r-- | openssl/src/ssl/error.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index 18e44cd6..b7e29c15 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -99,17 +99,18 @@ impl fmt::Display for Error { Some(_) => fmt.write_str("a nonblocking read call would have blocked"), None => fmt.write_str("the operation should be retried"), }, + ErrorCode::WANT_WRITE => match self.io_error() { + Some(_) => fmt.write_str("a nonblocking write call would have blocked"), + None => fmt.write_str("the operation should be retried"), + }, ErrorCode::SYSCALL => match self.io_error() { - Some(err) => write!(fmt, "the inner stream returned an error: {}", err), + Some(err) => write!(fmt, "{}", err), None => fmt.write_str("unexpected EOF"), }, - ErrorCode::SSL => { - fmt.write_str("OpenSSL error")?; - if let Some(ref err) = self.ssl_error() { - write!(fmt, ": {}", err)? - } - Ok(()) - } + ErrorCode::SSL => match self.ssl_error() { + Some(e) => write!(fmt, "{}", e), + None => fmt.write_str("OpenSSL error"), + }, ErrorCode(code) => write!(fmt, "unknown error code {}", code), } } |