tor-error: Put OnionService errors behind a new experimental-api feature

This commit is contained in:
Ian Jackson 2023-03-31 17:55:04 +01:00
parent 307af3714f
commit 68e5711684
3 changed files with 14 additions and 0 deletions

View File

@ -13,6 +13,7 @@ categories = ["rust-patterns"]
[features]
default = ["backtrace"]
experimental-api = []
[dependencies]
backtrace = { version = "0.3.39", optional = true }

View File

@ -12,4 +12,15 @@ crates higher up the dependency stack.
`backtrace` -- Enable backtraces in internal errors. (On by default.)
### Experimental and unstable features
Note that the APIs enabled by these features are NOT covered by
semantic versioning[^1] guarantees: we might break them or remove
them between patch versions.
* `experimental-api`: Add additional non-stable APIs to our public
interfaces.
License: MIT OR Apache-2.0
License: MIT OR Apache-2.0

View File

@ -462,6 +462,7 @@ pub enum ErrorKind {
/// This probably means that the hidden service is not running, or does not exist.
/// (It might mean that the directory servers are faulty,
/// and that the hidden service was unable to publish its descriptor.)
#[cfg(feature = "experimental-api")]
#[display(fmt = "Onion Service not found")]
OnionServiceNotFound,
@ -469,6 +470,7 @@ pub enum ErrorKind {
///
/// Something unexpected happened when trying to connect to the selected hidden service.
/// 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,