feat: add operational reconnect and shutdown handling
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent
b67248e14f
commit
10b8b24dce
+1
-57
@@ -17,7 +17,6 @@ pub enum TlsError {
|
||||
IdentityMismatch(String),
|
||||
|
||||
#[error("certificate expired: {0}")]
|
||||
#[allow(dead_code)]
|
||||
Expired(String),
|
||||
|
||||
#[error("certificate verification failed: {0}")]
|
||||
@@ -25,10 +24,6 @@ pub enum TlsError {
|
||||
|
||||
#[error("I/O error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("rustls error: {0}")]
|
||||
#[allow(dead_code)]
|
||||
Rustls(String),
|
||||
}
|
||||
|
||||
/// Errors that occur during application-level authentication.
|
||||
@@ -42,14 +37,6 @@ pub enum AuthError {
|
||||
|
||||
#[error("auth not yet completed")]
|
||||
NotAuthenticated,
|
||||
|
||||
#[error("auth token expired")]
|
||||
#[allow(dead_code)]
|
||||
Expired,
|
||||
|
||||
#[error("too many auth attempts")]
|
||||
#[allow(dead_code)]
|
||||
TooManyAttempts,
|
||||
}
|
||||
|
||||
/// Errors that occur during tunnel lifecycle operations.
|
||||
@@ -65,65 +52,22 @@ pub enum TunnelError {
|
||||
BindError(String, String),
|
||||
|
||||
#[error("connection refused: {0}")]
|
||||
ConnectionRefused(String),
|
||||
|
||||
#[error("connection closed")]
|
||||
#[allow(dead_code)]
|
||||
ConnectionClosed,
|
||||
ConnectionRefused(String),
|
||||
|
||||
#[error("port {0} already in use")]
|
||||
PortInUse(u16),
|
||||
|
||||
#[error("shutdown requested")]
|
||||
#[allow(dead_code)]
|
||||
Shutdown,
|
||||
|
||||
#[error("I/O error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("protocol error: {0}")]
|
||||
Protocol(String),
|
||||
|
||||
#[error("timeout: {0}")]
|
||||
#[allow(dead_code)]
|
||||
Timeout(String),
|
||||
|
||||
#[error("hostname error: {0}")]
|
||||
Host(#[from] HostError),
|
||||
}
|
||||
|
||||
/// Errors returned by the connector side.
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ConnectorError {
|
||||
#[error("TLS handshake failed: {0}")]
|
||||
TlsHandshake(String),
|
||||
|
||||
#[error("server certificate verification failed: {0}")]
|
||||
ServerCertVerification(String),
|
||||
|
||||
#[error("server certificate identity mismatch for {0}: {1}")]
|
||||
ServerIdentityMismatch(String, String),
|
||||
|
||||
#[error("server certificate expired")]
|
||||
ServerCertExpired,
|
||||
|
||||
#[error("auth rejected: {0}")]
|
||||
AuthRejected(String),
|
||||
|
||||
#[error("connection failed: {0}")]
|
||||
ConnectionFailed(String),
|
||||
|
||||
#[error("I/O error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("protocol error: {0}")]
|
||||
Protocol(String),
|
||||
|
||||
#[error("timeout: {0}")]
|
||||
Timeout(String),
|
||||
}
|
||||
|
||||
/// Errors returned during hostname resolution.
|
||||
#[derive(Debug, Error)]
|
||||
pub enum HostError {
|
||||
|
||||
Reference in New Issue
Block a user