s/ProtocolFailed/ProtocolViolation/g where possible

This commit is contained in:
Neel Chauhan 2023-04-08 07:47:28 -07:00
parent 2577a02191
commit 5d61ff04d1
4 changed files with 6 additions and 13 deletions

View File

@ -95,7 +95,7 @@ impl tor_error::HasKind for ConnectionError {
CE::UnsupportedUriScheme{..} => EK::NotImplemented,
CE::MissingHostname{..} => EK::BadApiUsage,
CE::Arti(e) => e.kind(),
CE::TLS(_) => EK::RemoteProtocolFailed,
CE::TLS(_) => EK::RemoteProtocolViolation,
}
}
}

View File

@ -238,7 +238,7 @@ impl tor_error::HasKind for ProxyError {
E::SocksProto(_) => EK::LocalProtocolViolation,
E::Bug(e) => e.kind(),
E::UnexpectedData => EK::NotImplemented,
E::SocksError(_) => EK::LocalProtocolFailed,
E::SocksError(_) => EK::LocalProtocolViolation,
}
}
}

View File

@ -338,13 +338,6 @@ pub enum ErrorKind {
#[display(fmt = "problem with network or connection")]
LocalNetworkError,
/// A problem occurred with a protocol to a local (not anonymized) party.
///
/// This is likely a protocol-specific problem, such as bad authentication
/// over SOCKS.
#[display(fmt = "local authentication refused.")]
LocalProtocolFailed,
/// A problem occurred when launching or communicating with an external
/// process running on this computer.
#[display(fmt = "an externally launched plug-in tool failed")]
@ -485,7 +478,7 @@ pub enum ErrorKind {
/// It seems to have been due to the hidden service violating the Tor protocols somehow.
#[cfg(feature = "experimental-api")]
#[display(fmt = "Onion Service protocol failed (apprently due to service behaviour)")]
OnionServiceProtocolFailed,
OnionServiceProtocolViolation,
/// An resolve operation finished with an error.
///
@ -509,8 +502,8 @@ pub enum ErrorKind {
/// protocol violation by the peer;
/// peer refusing to provide service;
/// etc.
#[display(fmt = "remote protocol failed")]
RemoteProtocolFailed,
#[display(fmt = "remote protocol violation")]
RemoteProtocolViolation,
/// An operation failed, and the relay in question reported that it's too
/// busy to answer our request.

View File

@ -61,7 +61,7 @@ impl HasKind for Error {
}
E::Syntax | E::Decode(_) | E::BadProtocol(_) => EK::LocalProtocolViolation,
E::NotImplemented(_) => EK::NotImplemented,
E::AuthRejected => EK::LocalProtocolFailed,
E::AuthRejected => EK::LocalProtocolViolation,
E::AlreadyFinished(e) => e.kind(),
E::Bug(e) => e.kind(),
}