Replace RemoteRefused with CircuitRefused.

Also document that it's a lower-level error kind.
This commit is contained in:
Nick Mathewson 2022-02-22 15:34:46 -05:00
parent f018d0c74b
commit 0d079071fe
2 changed files with 5 additions and 5 deletions

View File

@ -455,15 +455,15 @@ pub enum ErrorKind {
#[display(fmt = "requested resource is not available")]
RequestedResourceAbsent,
/// We asked a remote host to do something, and it declined.
/// We asked a relay to create or extend a circuit, and it declined.
///
/// Either it gave an error message indicating that it refused to perform
/// the request, or the protocol gives it no room to explain what happened.
///
/// The remote host in question is on the public internet, or an onion service.
/// This error does not relate to refusals by part of the Tor network.
/// You shouldn't typically see this kind of error; generally, higher-level
/// code should retry it.
#[display(fmt = "remote host refused our request")]
RemoteRefused,
CircuitRefused,
/// We were unable to construct a path through the Tor network.
///

View File

@ -143,7 +143,7 @@ impl HasKind for Error {
E::CircProto(_) => EK::TorProtocolViolation,
E::ChannelClosed | E::CircuitClosed => EK::CircuitCollapse,
E::IdRangeFull => EK::NamespaceFull,
E::CircRefused(_) => EK::RemoteRefused,
E::CircRefused(_) => EK::CircuitRefused,
E::BadStreamAddress => EK::BadApiUsage,
E::EndReceived(EndReason::DONE) => EK::RemoteStreamClosed,
E::EndReceived(EndReason::RESOLVEFAILED) => EK::RemoteNameError,