Crate tor_error

source ·
Expand description

tor-error

Support for error handling in Tor and Arti

Primarily, this crate provides the ErrorKind enum, and associated HasKind trait.

There is also some other miscellany, supporting error handling in crates higher up the dependency stack.

Features

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 versioning1 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


  1. Remember, semantic versioning is what makes various cargo features work reliably. To be explicit: if you want cargo update to only make safe changes, then you cannot enable these features. 

Macros

  • Create a bad API usage error, including a message like format!, and capturing this call site
  • Defines AsRef<dyn StdError + 'static> for a type implementing StdError
  • Create an internal error, including a message like format!, and capturing this call site
  • Helper for converting an error into an bad API usage error
  • Helper for converting an error into an internal error

Structs

  • Programming error (a bug)
  • A RetryTime wrapped so that it compares according to RetryTime::loose_cmp
  • Wraps any Error, providing a nicely-reporting Display impl
  • Helper type for reporting errors that are concrete implementors of StdError
  • Error type indicating that an input was incomplete, and could not be processed.

Enums

Traits

  • Extension trait providing .report() method on concrete errors
  • Errors that can be categorized as belonging to an ErrorKind
  • Trait for an error object that can tell us when the operation which generated it can be retried.

Functions