File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,9 +287,6 @@ pub enum Error {
287287 DbError ( DbError ) ,
288288 /// An error communicating with the Postgres server.
289289 IoError ( io:: Error ) ,
290- /// The communication channel with the Postgres server has desynchronized
291- /// due to an earlier communications error.
292- StreamDesynchronized ,
293290 /// An attempt was made to convert between incompatible Rust and Postgres
294291 /// types.
295292 WrongType ( Type ) ,
@@ -314,9 +311,6 @@ impl error::Error for Error {
314311 match * self {
315312 Error :: DbError ( _) => "An error reported by the Postgres server" ,
316313 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- }
320314 Error :: WrongType ( _) => "Unexpected type" ,
321315 Error :: InvalidColumn => "Invalid column" ,
322316 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 {
406406 "the server returned an unexpected response" )
407407}
408408
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+
409414/// An enumeration of transaction isolation levels.
410415///
411416/// 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 {
1313macro_rules! check_desync {
1414 ( $e: expr) => ( {
1515 if $e. is_desynchronized( ) {
16- return Err ( :: error:: Error :: StreamDesynchronized ) ;
16+ return Err ( :: error:: Error :: IoError ( :: desynchronized ( ) ) ) ;
1717 }
1818 } )
1919}
You can’t perform that action at this time.
0 commit comments