From cea7423cd399374f849f7405e0797a634a315be9 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 17 Sep 2016 15:05:07 -0700 Subject: [PATCH] Rename ConnectError::Ssl to Tls --- src/error/mod.rs | 10 +++++----- src/priv_io.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/error/mod.rs b/src/error/mod.rs index 8e8d61ef..477c09dc 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -177,8 +177,8 @@ pub enum ConnectError { ConnectParams(Box), /// An error from the Postgres server itself. Db(Box), - /// An error initializing the SSL session. - Ssl(Box), + /// An error initializing the TLS session. + Tls(Box), /// An error communicating with the server. Io(io::Error), } @@ -189,7 +189,7 @@ impl fmt::Display for ConnectError { match *self { ConnectError::ConnectParams(ref msg) => write!(fmt, ": {}", msg), ConnectError::Db(ref err) => write!(fmt, ": {}", err), - ConnectError::Ssl(ref err) => write!(fmt, ": {}", err), + ConnectError::Tls(ref err) => write!(fmt, ": {}", err), ConnectError::Io(ref err) => write!(fmt, ": {}", err), } } @@ -200,7 +200,7 @@ impl error::Error for ConnectError { match *self { ConnectError::ConnectParams(_) => "Invalid connection parameters", ConnectError::Db(_) => "Error reported by Postgres", - ConnectError::Ssl(_) => "Error initiating SSL session", + ConnectError::Tls(_) => "Error initiating SSL session", ConnectError::Io(_) => "Error communicating with the server", } } @@ -208,7 +208,7 @@ impl error::Error for ConnectError { fn cause(&self) -> Option<&error::Error> { match *self { ConnectError::ConnectParams(ref err) | - ConnectError::Ssl(ref err) => Some(&**err), + ConnectError::Tls(ref err) => Some(&**err), ConnectError::Db(ref err) => Some(&**err), ConnectError::Io(ref err) => Some(err), } diff --git a/src/priv_io.rs b/src/priv_io.rs index 34e70222..b0630ac7 100644 --- a/src/priv_io.rs +++ b/src/priv_io.rs @@ -252,7 +252,7 @@ pub fn initialize_stream(params: &ConnectParams, if try!(socket.read_u8()) == b'N' { if tls_required { - return Err(ConnectError::Ssl("the server does not support TLS".into())); + return Err(ConnectError::Tls("the server does not support TLS".into())); } else { return Ok(Box::new(socket)); } @@ -264,5 +264,5 @@ pub fn initialize_stream(params: &ConnectParams, ConnectTarget::Unix(_) => return Err(ConnectError::Io(::bad_response())), }; - handshaker.tls_handshake(host, socket).map_err(ConnectError::Ssl) + handshaker.tls_handshake(host, socket).map_err(ConnectError::Tls) }