add tls_client_connection, rehandshake methods

This commit is contained in:
yggverse 2024-11-30 01:48:33 +02:00
parent c4c173f6cf
commit b3e9bf239c
2 changed files with 37 additions and 6 deletions

View file

@ -2,20 +2,24 @@ use std::fmt::{Display, Formatter, Result};
#[derive(Debug)]
pub enum Error {
SocketConnectionClosed,
Rehandshake(glib::Error),
SocketConnection(glib::Error),
SocketConnectionClosed,
TlsClientConnection(glib::Error),
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result {
match self {
Self::SocketConnectionClosed => write!(f, "Socket connection closed"),
Self::SocketConnection(reason) => {
write!(f, "Socket connection error: {reason}")
Self::Rehandshake(e) => {
write!(f, "Rehandshake error: {e}")
}
Self::TlsClientConnection(reason) => {
write!(f, "TLS client connection error: {reason}")
Self::SocketConnectionClosed => write!(f, "Socket connection closed"),
Self::SocketConnection(e) => {
write!(f, "Socket connection error: {e}")
}
Self::TlsClientConnection(e) => {
write!(f, "TLS client connection error: {e}")
}
}
}