Loading crates/tor-dirmgr/src/err.rs +12 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,17 @@ pub enum Error { cause: Arc<SpawnError>, }, /// Other error from an external directory provider #[error("external directory provider")] ExternalDirProvider { /// What happened #[source] cause: Arc<dyn std::error::Error + Send + Sync + 'static>, /// The kind kind: ErrorKind, }, /// A programming problem, either in our code or the code calling it. #[error("programming problem: {0}")] Bug(#[from] tor_error::Bug), Loading Loading @@ -168,6 +179,7 @@ impl HasKind for Error { E::IOError(_) => EK::CacheAccessFailed, E::OfflineMode => EK::BadApiUsage, E::Spawn { cause, .. } => cause.kind(), E::ExternalDirProvider { kind, .. } => *kind, E::Bug(e) => e.kind(), } } Loading crates/tor-error/src/lib.rs +10 −0 Original line number Diff line number Diff line Loading @@ -532,6 +532,16 @@ pub enum ErrorKind { /// our [bug tracker](https://gitlab.torproject.org/tpo/core/arti/-/issues). #[display(fmt = "internal error (bug)")] Internal, /// Unclassified error /// /// Some other error occurred, which does not fit into any of the other kinds. /// /// This kind is provided for use by external code /// hooking into or replacing parts of Arti. /// It is never returned by the code in Arti (`arti-*` and `tor-*` crates). #[display(fmt = "unclassified error")] Other, } /// Errors that can be categorized as belonging to an [`ErrorKind`] Loading Loading
crates/tor-dirmgr/src/err.rs +12 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,17 @@ pub enum Error { cause: Arc<SpawnError>, }, /// Other error from an external directory provider #[error("external directory provider")] ExternalDirProvider { /// What happened #[source] cause: Arc<dyn std::error::Error + Send + Sync + 'static>, /// The kind kind: ErrorKind, }, /// A programming problem, either in our code or the code calling it. #[error("programming problem: {0}")] Bug(#[from] tor_error::Bug), Loading Loading @@ -168,6 +179,7 @@ impl HasKind for Error { E::IOError(_) => EK::CacheAccessFailed, E::OfflineMode => EK::BadApiUsage, E::Spawn { cause, .. } => cause.kind(), E::ExternalDirProvider { kind, .. } => *kind, E::Bug(e) => e.kind(), } } Loading
crates/tor-error/src/lib.rs +10 −0 Original line number Diff line number Diff line Loading @@ -532,6 +532,16 @@ pub enum ErrorKind { /// our [bug tracker](https://gitlab.torproject.org/tpo/core/arti/-/issues). #[display(fmt = "internal error (bug)")] Internal, /// Unclassified error /// /// Some other error occurred, which does not fit into any of the other kinds. /// /// This kind is provided for use by external code /// hooking into or replacing parts of Arti. /// It is never returned by the code in Arti (`arti-*` and `tor-*` crates). #[display(fmt = "unclassified error")] Other, } /// Errors that can be categorized as belonging to an [`ErrorKind`] Loading