0.5.0
This commit is contained in:
@@ -20,6 +20,8 @@ pub enum KbError {
|
||||
Http(std::string::String),
|
||||
/// WebSocket transport error.
|
||||
Ws(std::string::String),
|
||||
/// Database error.
|
||||
Db(std::string::String),
|
||||
/// Invalid internal state error.
|
||||
InvalidState(std::string::String),
|
||||
/// Operation requested while the client is not connected.
|
||||
@@ -29,38 +31,38 @@ pub enum KbError {
|
||||
}
|
||||
|
||||
impl std::fmt::Display for KbError {
|
||||
fn fmt(
|
||||
&self,
|
||||
formatter: &mut std::fmt::Formatter<'_>,
|
||||
) -> std::fmt::Result {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Config(message) => {
|
||||
write!(formatter, "configuration error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Io(message) => {
|
||||
write!(formatter, "io error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Json(message) => {
|
||||
write!(formatter, "json error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Tracing(message) => {
|
||||
write!(formatter, "tracing error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Http(message) => {
|
||||
write!(formatter, "http error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Ws(message) => {
|
||||
write!(formatter, "websocket error: {message}")
|
||||
},
|
||||
}
|
||||
Self::Db(message) => {
|
||||
write!(formatter, "db error: {}", message)
|
||||
}
|
||||
Self::InvalidState(message) => {
|
||||
write!(formatter, "invalid state: {message}")
|
||||
},
|
||||
}
|
||||
Self::NotConnected(message) => {
|
||||
write!(formatter, "not connected: {message}")
|
||||
},
|
||||
}
|
||||
Self::NotImplemented(message) => {
|
||||
write!(formatter, "not implemented: {message}")
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user