implemented display for clienterror
This commit is contained in:
parent
894327ba00
commit
d1c583e997
|
@ -318,6 +318,17 @@ pub enum ClientError {
|
|||
ServerPanicked,
|
||||
TimeoutReached,
|
||||
}
|
||||
impl Display for ClientError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self.to_owned() {
|
||||
Self::FailedDecode => write!(f, "Failed to decode response"),
|
||||
Self::FailedToSend => write!(f, "Failed to send job"),
|
||||
Self::InvalidResponse => write!(f, "Received invalid response"),
|
||||
Self::ServerPanicked => write!(f, "The server on the other end has panicked"),
|
||||
Self::TimeoutReached => write!(f, "The client has reached the timeout"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A Client-side trait that needs to be implemented for a type in order for the client to know return types.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue