Skip to content

Commit cea7423

Browse files
committed
Rename ConnectError::Ssl to Tls
1 parent 25ba140 commit cea7423

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/error/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ pub enum ConnectError {
177177
ConnectParams(Box<error::Error + Sync + Send>),
178178
/// An error from the Postgres server itself.
179179
Db(Box<DbError>),
180-
/// An error initializing the SSL session.
181-
Ssl(Box<error::Error + Sync + Send>),
180+
/// An error initializing the TLS session.
181+
Tls(Box<error::Error + Sync + Send>),
182182
/// An error communicating with the server.
183183
Io(io::Error),
184184
}
@@ -189,7 +189,7 @@ impl fmt::Display for ConnectError {
189189
match *self {
190190
ConnectError::ConnectParams(ref msg) => write!(fmt, ": {}", msg),
191191
ConnectError::Db(ref err) => write!(fmt, ": {}", err),
192-
ConnectError::Ssl(ref err) => write!(fmt, ": {}", err),
192+
ConnectError::Tls(ref err) => write!(fmt, ": {}", err),
193193
ConnectError::Io(ref err) => write!(fmt, ": {}", err),
194194
}
195195
}
@@ -200,15 +200,15 @@ impl error::Error for ConnectError {
200200
match *self {
201201
ConnectError::ConnectParams(_) => "Invalid connection parameters",
202202
ConnectError::Db(_) => "Error reported by Postgres",
203-
ConnectError::Ssl(_) => "Error initiating SSL session",
203+
ConnectError::Tls(_) => "Error initiating SSL session",
204204
ConnectError::Io(_) => "Error communicating with the server",
205205
}
206206
}
207207

208208
fn cause(&self) -> Option<&error::Error> {
209209
match *self {
210210
ConnectError::ConnectParams(ref err) |
211-
ConnectError::Ssl(ref err) => Some(&**err),
211+
ConnectError::Tls(ref err) => Some(&**err),
212212
ConnectError::Db(ref err) => Some(&**err),
213213
ConnectError::Io(ref err) => Some(err),
214214
}

src/priv_io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ pub fn initialize_stream(params: &ConnectParams,
252252

253253
if try!(socket.read_u8()) == b'N' {
254254
if tls_required {
255-
return Err(ConnectError::Ssl("the server does not support TLS".into()));
255+
return Err(ConnectError::Tls("the server does not support TLS".into()));
256256
} else {
257257
return Ok(Box::new(socket));
258258
}
@@ -264,5 +264,5 @@ pub fn initialize_stream(params: &ConnectParams,
264264
ConnectTarget::Unix(_) => return Err(ConnectError::Io(::bad_response())),
265265
};
266266

267-
handshaker.tls_handshake(host, socket).map_err(ConnectError::Ssl)
267+
handshaker.tls_handshake(host, socket).map_err(ConnectError::Tls)
268268
}

0 commit comments

Comments
 (0)