add error translation to tcp errors
Translation of tpc client ConnectError and Error to the appropriate embedded_io_async errors
This commit is contained in:
parent
0fd9d7400b
commit
eb05a18c45
1 changed files with 9 additions and 2 deletions
|
@ -384,13 +384,20 @@ mod embedded_io_impls {
|
|||
|
||||
impl embedded_io_async::Error for ConnectError {
|
||||
fn kind(&self) -> embedded_io_async::ErrorKind {
|
||||
embedded_io_async::ErrorKind::Other
|
||||
match self {
|
||||
ConnectError::ConnectionReset => embedded_io_async::ErrorKind::ConnectionReset,
|
||||
ConnectError::TimedOut => embedded_io_async::ErrorKind::TimedOut,
|
||||
ConnectError::NoRoute => embedded_io_async::ErrorKind::NotConnected,
|
||||
ConnectError::InvalidState => embedded_io_async::ErrorKind::Other,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl embedded_io_async::Error for Error {
|
||||
fn kind(&self) -> embedded_io_async::ErrorKind {
|
||||
embedded_io_async::ErrorKind::Other
|
||||
match self {
|
||||
Error::ConnectionReset => embedded_io_async::ErrorKind::ConnectionReset,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue