Skip to content

Commit

Permalink
Removed TLS errors as those are not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
GunnarMorrigan committed Jan 13, 2023
1 parent 78dd2e9 commit e12b995
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::packets::{
{Packet, PacketType},
};

/// Errors that the [`mqrstt::EventHandler`] can emit
#[derive(Debug, Clone, thiserror::Error)]
pub enum MqttError {
#[error("Missing Packet ID")]
Expand All @@ -29,6 +30,7 @@ pub enum MqttError {
Unsolicited(u16, PacketType),
}

/// Errors producable by the [`mqrstt::AsyncClient`]
#[derive(Debug, Clone, thiserror::Error)]
pub enum ClientError {
#[error("One of more of the internal handler channels are closed")]
Expand All @@ -38,7 +40,7 @@ pub enum ClientError {
NoNetwork,
}

/// Critical errors during eventloop polling
/// Critical errors that can happen during the operation of the entire client
#[derive(Debug, thiserror::Error)]
pub enum ConnectionError {
#[error("No network connection")]
Expand Down Expand Up @@ -85,27 +87,4 @@ impl From<SendError<Packet>> for ReadBytes<ConnectionError> {
fn from(value: SendError<Packet>) -> Self {
ReadBytes::Err(value.into())
}
}

#[derive(Debug, thiserror::Error)]
pub enum TlsError {
#[error("There is no or an incorrect TLS configuration for the requested TLS connection")]
NoTlsConfig,

#[error("Io error")]
TlsIoError(#[from] io::Error),

#[error("Could no construct a valid root certificate")]
NoValidRootCertInChain,

#[error("Could not construct a valid private key")]
NoValidPrivateKey,

#[cfg(any(feature = "tokio-rustls", feature = "smol-rustls"))]
#[error("{0}")]
RustlsError(#[from] rustls::Error),

#[cfg(any(feature = "tokio-rustls", feature = "smol-rustls"))]
#[error("{0}")]
RustlsInvalidDnsNameError(#[from] rustls::client::InvalidDnsNameError),
}
}

0 comments on commit e12b995

Please sign in to comment.