1#[derive(thiserror::Error, Debug)]
3pub enum Error {
4 #[error("{0}")]
6 Io(#[from] std::io::Error),
7 #[error("{0}")]
9 ParseError(#[from] std::string::ParseError),
10 #[error("Target address is invalid: {0}")]
13 InvalidTargetAddress(&'static str),
14 #[error("Proxy server unreachable")]
16 ProxyServerUnreachable,
17 #[error("Invalid response version")]
19 InvalidResponseVersion,
20 #[error("No acceptable auth methods")]
22 NoAcceptableAuthMethods,
23 #[error("Unknown auth method")]
25 UnknownAuthMethod,
26 #[error("General SOCKS server failure")]
28 GeneralSocksServerFailure,
29 #[error("Connection not allowed by ruleset")]
31 ConnectionNotAllowedByRuleset,
32 #[error("Network unreachable")]
34 NetworkUnreachable,
35 #[error("Host unreachable")]
37 HostUnreachable,
38 #[error("Connection refused")]
40 ConnectionRefused,
41 #[error("TTL expired")]
43 TtlExpired,
44 #[error("Command not supported")]
46 CommandNotSupported,
47 #[error("Address type not supported")]
49 AddressTypeNotSupported,
50 #[error("Unknown error")]
52 UnknownError,
53 #[error("SOCKS5 UDP fragmentation is not supported")]
55 FragmentationNotSupported,
56 #[error("Invalid reserved byte")]
58 InvalidReservedByte,
59 #[error("Unknown address type")]
61 UnknownAddressType,
62 #[error("Invalid auth values: {0}")]
64 InvalidAuthValues(&'static str),
65 #[error("Password auth failure, code: {0}")]
67 PasswordAuthFailure(u8),
68
69 #[error("Authorization required")]
70 AuthorizationRequired,
71}