From 47e957ec3cb35c61d72b2d4e06e048a657920aa0 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 29 Oct 2025 15:20:33 +0800 Subject: Add new error types and sort variants alphabetically - Add Authentication, Locked, NoResult, and NotFound error variants - Remove Crypto error variant - Reorder all variants in A-Z order for better maintainability --- crates/utils/tcp_connection/src/error.rs | 49 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'crates/utils/tcp_connection') diff --git a/crates/utils/tcp_connection/src/error.rs b/crates/utils/tcp_connection/src/error.rs index cfea060..3667a59 100644 --- a/crates/utils/tcp_connection/src/error.rs +++ b/crates/utils/tcp_connection/src/error.rs @@ -3,38 +3,32 @@ use thiserror::Error; #[derive(Error, Debug, Clone)] pub enum TcpTargetError { - #[error("I/O error: {0}")] - Io(String), - - #[error("Serialization error: {0}")] - Serialization(String), + #[error("Authentication failed: {0}")] + Authentication(String), #[error("Cryptographic error: {0}")] Crypto(String), - #[error("Protocol error: {0}")] - Protocol(String), - - #[error("Authentication failed: {0}")] - Authentication(String), - #[error("File operation error: {0}")] File(String), - #[error("Network error: {0}")] - Network(String), + #[error("I/O error: {0}")] + Io(String), #[error("Invalid configuration: {0}")] Config(String), - #[error("Timeout: {0}")] - Timeout(String), + #[error("Locked: {0}")] + Locked(String), - #[error("Unsupported operation: {0}")] - Unsupported(String), + #[error("Network error: {0}")] + Network(String), - #[error("Pool already exists: {0}")] - PoolAlreadyExists(String), + #[error("No result: {0}")] + NoResult(String), + + #[error("Not found: {0}")] + NotFound(String), #[error("Not local machine: {0}")] NotLocal(String), @@ -42,11 +36,20 @@ pub enum TcpTargetError { #[error("Not remote machine: {0}")] NotRemote(String), - #[error("Not found: {0}")] - NotFound(String), + #[error("Pool already exists: {0}")] + PoolAlreadyExists(String), - #[error("Locked: {0}")] - Locked(String), + #[error("Protocol error: {0}")] + Protocol(String), + + #[error("Serialization error: {0}")] + Serialization(String), + + #[error("Timeout: {0}")] + Timeout(String), + + #[error("Unsupported operation: {0}")] + Unsupported(String), } impl From for TcpTargetError { -- cgit