aboutsummaryrefslogtreecommitdiff
path: root/src/ssl/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssl/error.rs')
-rw-r--r--src/ssl/error.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ssl/error.rs b/src/ssl/error.rs
index c52879a0..027554c5 100644
--- a/src/ssl/error.rs
+++ b/src/ssl/error.rs
@@ -3,13 +3,14 @@ pub use self::OpensslError::*;
use libc::c_ulong;
use std::error;
+use std::fmt;
use std::ffi::c_str_to_bytes;
-use std::io::IoError;
+use std::old_io::IoError;
use ffi;
/// An SSL error
-#[derive(Show, Clone, PartialEq, Eq)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SslError {
/// The underlying stream reported an error
StreamError(IoError),
@@ -19,6 +20,12 @@ pub enum SslError {
OpenSslErrors(Vec<OpensslError>)
}
+impl fmt::Display for SslError {
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ fmt.write_str(error::Error::description(self))
+ }
+}
+
impl error::Error for SslError {
fn description(&self) -> &str {
match *self {
@@ -37,7 +44,7 @@ impl error::Error for SslError {
}
/// An error from the OpenSSL library
-#[derive(Show, Clone, PartialEq, Eq)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub enum OpensslError {
/// An unknown error
UnknownError {