mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
reorganize error types, return socket_connection on init error
This commit is contained in:
parent
44196608ce
commit
cc1018224a
2 changed files with 16 additions and 10 deletions
|
|
@ -3,21 +3,25 @@ use std::fmt::{Display, Formatter, Result};
|
|||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
Connect(glib::Error),
|
||||
Connection(crate::client::connection::Error),
|
||||
Request(crate::client::connection::request::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::Connection(e) => {
|
||||
write!(f, "Connection error: {e}")
|
||||
}
|
||||
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, "Request error: {e}")
|
||||
write!(f, "Connection error: {e}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue