mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
update enum names
This commit is contained in:
parent
5737b89278
commit
017a63b4e5
2 changed files with 8 additions and 6 deletions
|
|
@ -58,7 +58,7 @@ pub fn auth(
|
||||||
certificate: TlsCertificate,
|
certificate: TlsCertificate,
|
||||||
) -> Result<TlsClientConnection, Error> {
|
) -> Result<TlsClientConnection, Error> {
|
||||||
if socket_connection.is_closed() {
|
if socket_connection.is_closed() {
|
||||||
return Err(Error::Closed);
|
return Err(Error::SocketConnectionClosed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#the-use-of-tls
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#the-use-of-tls
|
||||||
|
|
@ -77,6 +77,6 @@ pub fn auth(
|
||||||
|
|
||||||
Ok(tls_client_connection)
|
Ok(tls_client_connection)
|
||||||
}
|
}
|
||||||
Err(reason) => Err(Error::Tls(reason)),
|
Err(reason) => Err(Error::TlsClientConnection(reason)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,17 @@ use std::fmt::{Display, Formatter, Result};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
Closed,
|
SocketConnectionClosed,
|
||||||
Tls(glib::Error),
|
TlsClientConnection(glib::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Error {
|
impl Display for Error {
|
||||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||||
match self {
|
match self {
|
||||||
Self::Closed => write!(f, "Socket connection closed"),
|
Self::SocketConnectionClosed => write!(f, "Socket connection closed"),
|
||||||
Self::Tls(reason) => write!(f, "Could not create TLS connection: {reason}"),
|
Self::TlsClientConnection(reason) => {
|
||||||
|
write!(f, "Could not create TLS connection: {reason}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue