mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
24 lines
540 B
Rust
24 lines
540 B
Rust
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
Decode(std::string::FromUtf8Error),
|
|
Protocol,
|
|
Undefined,
|
|
}
|
|
|
|
impl Display for Error {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
match self {
|
|
Self::Decode(e) => {
|
|
write!(f, "Decode error: {e}")
|
|
}
|
|
Self::Protocol => {
|
|
write!(f, "Protocol error")
|
|
}
|
|
Self::Undefined => {
|
|
write!(f, "Undefined error")
|
|
}
|
|
}
|
|
}
|
|
}
|