mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
28 lines
844 B
Rust
28 lines
844 B
Rust
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
Connect(gio::NetworkAddress, glib::Error),
|
|
Connection(gio::SocketConnection, crate::client::connection::Error),
|
|
NetworkAddress(crate::client::connection::request::Error),
|
|
Request(crate::client::connection::Error),
|
|
}
|
|
|
|
impl Display for Error {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
match self {
|
|
Self::Connect(_, e) => {
|
|
write!(f, "Connect error: {e}")
|
|
}
|
|
Self::Connection(_, e) => {
|
|
write!(f, "Connection init error: {e}")
|
|
}
|
|
Self::NetworkAddress(e) => {
|
|
write!(f, "Network address error: {e}")
|
|
}
|
|
Self::Request(e) => {
|
|
write!(f, "Connection error: {e}")
|
|
}
|
|
}
|
|
}
|
|
}
|