diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs index 0ed30a5..99acdd1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -34,8 +34,11 @@ pub enum Error { #[error(display = "Connection closed")] ConnectionClosed, - #[error(display = "Remote error: {}", _0)] - Remote(String), + #[error(display = "Version mismatch: {}", _0)] + VersionMismatch(String), + + #[error(display = "Remote error {}: {}", _0, _1)] + Remote(u8, String), } impl Error { @@ -50,7 +53,8 @@ impl Error { Self::NoHandler => 20, Self::ConnectionClosed => 21, Self::Handshake(_) => 30, - Self::Remote(_) => 40, + Self::VersionMismatch(_) => 31, + Self::Remote(c, _) => *c, Self::Message(_) => 99, } } |