From 2211f324782cdc617b4b5ecd071178e372539fe4 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 26 Mar 2025 14:29:40 +0000 Subject: refactor: rename crates and move client logic to separate crate `filament` --- jabber/src/error.rs | 58 ----------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 jabber/src/error.rs (limited to 'jabber/src/error.rs') diff --git a/jabber/src/error.rs b/jabber/src/error.rs deleted file mode 100644 index ec60778..0000000 --- a/jabber/src/error.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::str::Utf8Error; -use std::sync::Arc; - -use jid::ParseError; -use rsasl::mechname::MechanismNameError; -use stanza::client::error::Error as ClientError; -use stanza::sasl::Failure; -use stanza::stream::Error as StreamError; -use thiserror::Error; - -#[derive(Error, Debug, Clone)] -pub enum Error { - #[error("connection")] - Connection, - #[error("utf8 decode: {0}")] - Utf8Decode(#[from] Utf8Error), - #[error("negotiation")] - Negotiation, - #[error("tls required")] - TlsRequired, - #[error("already connected with tls")] - AlreadyTls, - // TODO: specify unsupported feature - #[error("unsupported feature")] - Unsupported, - #[error("jid missing localpart")] - NoLocalpart, - #[error("received unexpected element: {0:?}")] - UnexpectedElement(peanuts::Element), - #[error("xml error: {0}")] - XML(#[from] peanuts::Error), - #[error("sasl error: {0}")] - SASL(#[from] SASLError), - #[error("jid error: {0}")] - JID(#[from] ParseError), - #[error("client stanza error: {0}")] - ClientError(#[from] ClientError), - #[error("stream error: {0}")] - StreamError(#[from] StreamError), - #[error("error missing")] - MissingError, -} - -#[derive(Error, Debug, Clone)] -pub enum SASLError { - #[error("sasl error: {0}")] - SASL(Arc), - #[error("mechanism error: {0}")] - MechanismName(#[from] MechanismNameError), - #[error("authentication failure: {0}")] - Authentication(#[from] Failure), -} - -impl From for SASLError { - fn from(e: rsasl::prelude::SASLError) -> Self { - Self::SASL(Arc::new(e)) - } -} -- cgit