Skip to content

Commit 299151a

Browse files
Errors pertaining to ClientSocket impl.
Implemented TimeoutError and ProtocolParseError
1 parent 2fa60ab commit 299151a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

net/src/socket/client/error.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
use std::io::Error;
22

3+
use crate::protocol::error::ProtocolError;
4+
35
/// An enum to represent the different errors that can occur for the [crate::socket::client::ClientSocket] instance
46
pub enum ClientSocketError{
57
/// Indicates that the error caused is due to I/O operations by tcp_listner and other I/O object
68
IoError{
79
/// The underlying I/O Error
810
source:Error
11+
},
12+
13+
14+
/// Indicates that the socket has timed out of transcating (I/O) data
15+
TimeoutError{
16+
message:String
17+
},
18+
19+
20+
/// Indiacates that an error has occured during the parsing of data
21+
ProtocolParseError{
22+
source:ProtocolError
923
}
24+
25+
1026
}
1127

1228
/// From implementation to typecast [std::io::Error] to [ClientSocketError]

0 commit comments

Comments
 (0)