#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("{0}")]
Io(#[from] std::io::Error),
#[error("{0}")]
ParseError(#[from] std::string::ParseError),
#[error("Target address is invalid: {0}")]
InvalidTargetAddress(&'static str),
#[error("Proxy server unreachable")]
ProxyServerUnreachable,
#[error("Invalid response version")]
InvalidResponseVersion,
#[error("No acceptable auth methods")]
NoAcceptableAuthMethods,
#[error("Unknown auth method")]
UnknownAuthMethod,
#[error("General SOCKS server failure")]
GeneralSocksServerFailure,
#[error("Connection not allowed by ruleset")]
ConnectionNotAllowedByRuleset,
#[error("Network unreachable")]
NetworkUnreachable,
#[error("Host unreachable")]
HostUnreachable,
#[error("Connection refused")]
ConnectionRefused,
#[error("TTL expired")]
TtlExpired,
#[error("Command not supported")]
CommandNotSupported,
#[error("Address type not supported")]
AddressTypeNotSupported,
#[error("Unknown error")]
UnknownError,
#[error("Invalid reserved byte")]
InvalidReservedByte,
#[error("Unknown address type")]
UnknownAddressType,
#[error("Invalid auth values: {0}")]
InvalidAuthValues(&'static str),
#[error("Password auth failure, code: {0}")]
PasswordAuthFailure(u8),
#[error("Authorization required")]
AuthorizationRequired,
#[error("Request rejected because SOCKS server cannot connect to identd on the client")]
IdentdAuthFailure,
#[error("Request rejected because the client program and identd report different user-ids")]
InvalidUserIdAuthFailure,
}