File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -287,9 +287,6 @@ pub enum Error {
287
287
DbError ( DbError ) ,
288
288
/// An error communicating with the Postgres server.
289
289
IoError ( io:: Error ) ,
290
- /// The communication channel with the Postgres server has desynchronized
291
- /// due to an earlier communications error.
292
- StreamDesynchronized ,
293
290
/// An attempt was made to convert between incompatible Rust and Postgres
294
291
/// types.
295
292
WrongType ( Type ) ,
@@ -314,9 +311,6 @@ impl error::Error for Error {
314
311
match * self {
315
312
Error :: DbError ( _) => "An error reported by the Postgres server" ,
316
313
Error :: IoError ( _) => "An error communicating with the Postgres server" ,
317
- Error :: StreamDesynchronized => {
318
- "Communication with the server has desynchronized due to an earlier IO error"
319
- }
320
314
Error :: WrongType ( _) => "Unexpected type" ,
321
315
Error :: InvalidColumn => "Invalid column" ,
322
316
Error :: Conversion ( _) => "An error converting between Postgres and Rust types" ,
Original file line number Diff line number Diff line change @@ -406,6 +406,11 @@ fn bad_response() -> std_io::Error {
406
406
"the server returned an unexpected response" )
407
407
}
408
408
409
+ fn desynchronized ( ) -> std_io:: Error {
410
+ std_io:: Error :: new ( std_io:: ErrorKind :: Other ,
411
+ "communication with the server has desynchronized due to an earlier IO error" )
412
+ }
413
+
409
414
/// An enumeration of transaction isolation levels.
410
415
///
411
416
/// See the [Postgres documentation](http://www.postgresql.org/docs/9.4/static/transaction-iso.html)
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ macro_rules! try_desync {
13
13
macro_rules! check_desync {
14
14
( $e: expr) => ( {
15
15
if $e. is_desynchronized( ) {
16
- return Err ( :: error:: Error :: StreamDesynchronized ) ;
16
+ return Err ( :: error:: Error :: IoError ( :: desynchronized ( ) ) ) ;
17
17
}
18
18
} )
19
19
}
You can’t perform that action at this time.
0 commit comments