mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 09:05:45 +00:00
26 lines
711 B
Rust
26 lines
711 B
Rust
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
Closed,
|
|
Rehandshake(glib::Error),
|
|
SocketConnection(glib::Error),
|
|
TlsClientConnection(glib::Error),
|
|
}
|
|
|
|
impl Display for Error {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
match self {
|
|
Self::Closed => write!(f, "Connection closed"),
|
|
Self::Rehandshake(e) => {
|
|
write!(f, "Rehandshake error: {e}")
|
|
}
|
|
Self::SocketConnection(e) => {
|
|
write!(f, "Socket connection error: {e}")
|
|
}
|
|
Self::TlsClientConnection(e) => {
|
|
write!(f, "TLS client connection error: {e}")
|
|
}
|
|
}
|
|
}
|
|
}
|