Skip to content

Commit 96d1a3a

Browse files
committed
Drop Error::StreamDesynchronized
1 parent f800835 commit 96d1a3a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/error.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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",

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ macro_rules! try_desync {
1313
macro_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
}

0 commit comments

Comments
 (0)