aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-21 13:45:41 +0100
committerAlex Auvolat <alex@adnab.me>2022-02-21 13:45:41 +0100
commit96a3cc1e1f5c0c4e73ad1036a7e0add19d9a197e (patch)
tree3903e11ac310ec441db2360b6951b35c63617974 /src/client.rs
parent5bf3886fa28812d7009fb3bb481f0d3ce3004e18 (diff)
downloadnetapp-96a3cc1e1f5c0c4e73ad1036a7e0add19d9a197e.tar.gz
netapp-96a3cc1e1f5c0c4e73ad1036a7e0add19d9a197e.zip
Implement version check & transmit more error info
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index 62f876b..e84c85e 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -206,7 +206,8 @@ impl ClientConn {
<T as Message>::Response,
>(&resp[1..])?)
} else {
- Err(Error::Remote(format!("Remote error code {}", code)))
+ let msg = String::from_utf8(resp[1..].to_vec()).unwrap_or_default();
+ Err(Error::Remote(code, msg))
}
}
}