@@ -217,6 +217,9 @@ impl fmt::Display for ConnectError {
217
217
try!( fmt. write_str ( error:: Error :: description ( self ) ) ) ;
218
218
match * self {
219
219
ConnectError :: InvalidUrl ( ref msg) => write ! ( fmt, ": {}" , msg) ,
220
+ ConnectError :: DbError ( ref err) => write ! ( fmt, ": {}" , err) ,
221
+ ConnectError :: SslError ( ref err) => write ! ( fmt, ": {}" , err) ,
222
+ ConnectError :: IoError ( ref err) => write ! ( fmt, ": {}" , err) ,
220
223
_ => Ok ( ( ) )
221
224
}
222
225
}
@@ -227,14 +230,14 @@ impl error::Error for ConnectError {
227
230
match * self {
228
231
ConnectError :: InvalidUrl ( _) => "Invalid URL" ,
229
232
ConnectError :: MissingUser => "User missing in URL" ,
230
- ConnectError :: DbError ( _) => "An error from the Postgres server itself " ,
233
+ ConnectError :: DbError ( _) => "Error reported by Postgres" ,
231
234
ConnectError :: MissingPassword => "The server requested a password but none was provided" ,
232
235
ConnectError :: UnsupportedAuthentication => {
233
236
"The server requested an unsupported authentication method"
234
237
}
235
238
ConnectError :: NoSslSupport => "The server does not support SSL" ,
236
239
ConnectError :: SslError ( _) => "Error initiating SSL session" ,
237
- ConnectError :: IoError ( _) => "Error communicating with server" ,
240
+ ConnectError :: IoError ( _) => "Error communicating with the server" ,
238
241
}
239
242
}
240
243
@@ -300,7 +303,10 @@ impl fmt::Display for Error {
300
303
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
301
304
try!( fmt. write_str ( error:: Error :: description ( self ) ) ) ;
302
305
match * self {
306
+ Error :: DbError ( ref err) => write ! ( fmt, ": {}" , err) ,
307
+ Error :: IoError ( ref err) => write ! ( fmt, ": {}" , err) ,
303
308
Error :: WrongType ( ref ty) => write ! ( fmt, ": saw type {:?}" , ty) ,
309
+ Error :: Conversion ( ref err) => write ! ( fmt, ": {}" , err) ,
304
310
_ => Ok ( ( ) ) ,
305
311
}
306
312
}
@@ -309,11 +315,11 @@ impl fmt::Display for Error {
309
315
impl error:: Error for Error {
310
316
fn description ( & self ) -> & str {
311
317
match * self {
312
- Error :: DbError ( _) => "An error reported by the Postgres server " ,
313
- Error :: IoError ( _) => "An error communicating with the Postgres server" ,
318
+ Error :: DbError ( _) => "Error reported by Postgres" ,
319
+ Error :: IoError ( _) => "Error communicating with the server" ,
314
320
Error :: WrongType ( _) => "Unexpected type" ,
315
321
Error :: InvalidColumn => "Invalid column" ,
316
- Error :: Conversion ( _) => "An error converting between Postgres and Rust types" ,
322
+ Error :: Conversion ( _) => "Error converting between Postgres and Rust types" ,
317
323
}
318
324
}
319
325
0 commit comments