Enum tor_circmgr::Error
source · #[non_exhaustive]pub enum Error {
Show 18 variants
GuardNotUsable,
PendingCanceled,
PendingFailed(Box<Error>),
LostUsabilityRace(RestrictionFailed),
CircCanceled,
UsageMismatched(RestrictionFailed),
CircTimeout,
RequestTimeout,
NoPath {
role: &'static str,
can_share: FilterCount,
correct_usage: FilterCount,
},
NoExit {
can_share: FilterCount,
correct_ports: FilterCount,
correct_country: FilterCount,
},
GuardMgr(GuardMgrError),
Guard(PickGuardError),
RequestFailed(RetryError<Box<Error>>),
Channel {
peer: LoggedChanTarget,
cause: Error,
},
Protocol {
action: &'static str,
peer: Option<LoggedChanTarget>,
error: Error,
},
Spawn {
spawning: &'static str,
cause: Arc<SpawnError>,
},
State(Error),
Bug(Bug),
}Expand description
An error returned while looking up or building a circuit
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GuardNotUsable
We started building a circuit on a guard, but later decided not to use that guard.
PendingCanceled
We were waiting on a pending circuit, but it failed to report
PendingFailed(Box<Error>)
We were waiting on a pending circuits, but it failed.
LostUsabilityRace(RestrictionFailed)
We were told that we could use a given circuit, but before we got a chance to try it, its usage changed so that we had no longer find it suitable.
This is a version of UsageMismatched for when a race is the
likeliest explanation for the mismatch.
CircCanceled
A circuit succeeded, but was cancelled before it could be used.
Circuits can be cancelled either by a call to
retire_all_circuits(), or by a configuration change that
makes old paths unusable.
UsageMismatched(RestrictionFailed)
We were told that we could use a circuit, but when we tried, we found that its usage did not support what we wanted.
This can happen due to a race when a number of tasks all decide that they can use the same pending circuit at once: one of them will restrict the circuit, and the others will get this error.
See LostUsabilityRace.
CircTimeout
A circuit build took too long to finish.
RequestTimeout
A request spent too long waiting for a circuit
NoPath
Fields
Relays accepted and rejected based on relay family policies.
correct_usage: FilterCountRelays accepted and rejected based on our usage requirements.
No suitable relays for a request
NoExit
Fields
Exit relays accepted and rejected based on relay family policies.
correct_ports: FilterCountExit relays accepted and rejected base on the ports that we need.
correct_country: FilterCountExit relays accepted and rejected based on exit country code.
No suitable exit relay for a request.
GuardMgr(GuardMgrError)
Problem creating or updating a guard manager.
Guard(PickGuardError)
Problem selecting a guard relay.
RequestFailed(RetryError<Box<Error>>)
Unable to get or build a circuit, despite retrying.
Channel
Problem with channel
Protocol
Fields
peer: Option<LoggedChanTarget>The peer that created the protocol error.
This is set to None if we can’t blame a single party.
Protocol issue while building a circuit.
Spawn
Fields
Unable to spawn task
State(Error)
Problem loading or storing persistent state.
Bug(Bug)
An error caused by a programming issue . or a failure in another library that we can’t work around.
Implementations§
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<GuardMgrError> for Error
impl From<GuardMgrError> for Error
source§fn from(err: GuardMgrError) -> Error
fn from(err: GuardMgrError) -> Error
source§impl From<PickGuardError> for Error
impl From<PickGuardError> for Error
source§fn from(source: PickGuardError) -> Self
fn from(source: PickGuardError) -> Self
source§impl From<TimeoutError> for Error
impl From<TimeoutError> for Error
source§fn from(_: TimeoutError) -> Error
fn from(_: TimeoutError) -> Error
source§impl HasRetryTime for Error
impl HasRetryTime for Error
source§fn retry_time(&self) -> RetryTime
fn retry_time(&self) -> RetryTime
source§fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
fn abs_retry_time<F>(&self, now: Instant, choose_delay: F) -> AbsRetryTime
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.