mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 01:25:32 +00:00
draft new api version
This commit is contained in:
parent
67d486cc4d
commit
3a9e84a3d9
19 changed files with 490 additions and 87 deletions
|
|
@ -1,13 +1,33 @@
|
|||
use std::fmt::{Display, Formatter, Result};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
DataDecode,
|
||||
DataProtocol,
|
||||
InputStream,
|
||||
MimeDecode,
|
||||
MimeProtocol,
|
||||
MimeUndefined,
|
||||
Data(super::data::Error),
|
||||
InputStreamRead(Vec<u8>, glib::Error),
|
||||
Mime(super::mime::Error),
|
||||
Protocol,
|
||||
StatusDecode,
|
||||
StatusProtocol,
|
||||
StatusUndefined,
|
||||
Status(super::status::Error),
|
||||
}
|
||||
|
||||
impl Display for Error {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
match self {
|
||||
Self::Data(reason) => {
|
||||
write!(f, "Data error: {reason}")
|
||||
}
|
||||
Self::InputStreamRead(_, reason) => {
|
||||
// @TODO
|
||||
write!(f, "Input stream error: {reason}")
|
||||
}
|
||||
Self::Mime(reason) => {
|
||||
write!(f, "MIME error: {reason}")
|
||||
}
|
||||
Self::Protocol => {
|
||||
write!(f, "Protocol error")
|
||||
}
|
||||
Self::Status(reason) => {
|
||||
write!(f, "Status error: {reason}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue