luz/luz/src/error.rs

33 lines
599 B
Rust

pub enum Error {
AlreadyConnected,
Jabber(jabber::Error),
XML(peanuts::Error),
SQL(sqlx::Error),
JID(jid::ParseError),
AlreadyDisconnected,
}
impl From<peanuts::Error> for Error {
fn from(e: peanuts::Error) -> Self {
Self::XML(e)
}
}
impl From<jid::ParseError> for Error {
fn from(e: jid::ParseError) -> Self {
Self::JID(e)
}
}
impl From<sqlx::Error> for Error {
fn from(e: sqlx::Error) -> Self {
Self::SQL(e)
}
}
impl From<jabber::Error> for Error {
fn from(e: jabber::Error) -> Self {
Self::Jabber(e)
}
}