mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
23 lines
445 B
Rust
23 lines
445 B
Rust
use std::{
|
|
fmt::{Display, Formatter, Result},
|
|
str::Utf8Error,
|
|
};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
Code,
|
|
Utf8Error(Utf8Error),
|
|
}
|
|
|
|
impl Display for Error {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
match self {
|
|
Self::Code => {
|
|
write!(f, "Status code error")
|
|
}
|
|
Self::Utf8Error(e) => {
|
|
write!(f, "UTF-8 error: {e}")
|
|
}
|
|
}
|
|
}
|
|
}
|