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
Remember, semantic versioning is what makes various
cargo
features work reliably. To be explicit: if you wantcargo update
to only make safe changes, then you cannot enable these features. ↩
Modules§
- internal 🔒
- The InternalError type, macro for generating it, etc.
- misc 🔒
- Miscellaneous straightforward error structs for particular situations
- report 🔒
- The Report type which reports errors nicely
- retriable 🔒
- Declare the
RetryTime
enumeration and related code. - sealed 🔒
- Sealed
- tracing
tracing
- Support for using
tor-error
with thetracing
crate.
Macros§
- bad_
api_ usage - Create a bad API usage error, including a message like
format!
, and capturing this call site - debug_
report tracing
- Log a report for
err
at levelDEBUG
(or higher if it is a bug). - define_
asref_ dyn_ std_ error - Defines
AsRef<dyn StdError + 'static>
for a type implementingStdError
- error_
report tracing
- Log a report for
err
at levelERROR
- event_
report tracing
- Log a
Report
of a provided error at a given level, or a higher level if appropriate. - info_
report tracing
- Log a report for
err
at levelINFO
(or higher if it is a bug). - internal
- Create an internal error, including a message like
format!
, and capturing this call site - into_
bad_ api_ usage - Helper for converting an error into an bad API usage error
- into_
internal - Helper for converting an error into an internal error
- trace_
report tracing
- Log a report for
err
at levelTRACE
(or higher if it is a bug). - warn_
report tracing
- Log a report for
err
at levelWARN
Structs§
- Bug
- Programming error (a bug)
- Loose
CmpRetry Time - A
RetryTime
wrapped so that it compares according toRetryTime::loose_cmp
- Report
- Wraps any Error, providing a nicely-reporting Display impl
- Report
Helper - Helper type for reporting errors that are concrete implementors of
StdError
- Truncated
- Error type indicating that an input was incomplete, and could not be processed.
Enums§
- AbsRetry
Time - An absolute
RetryTime
. - Error
Kind - Classification of an error arising from Arti’s Tor operations
- Retry
Time - A description of when an operation may be retried.
Traits§
- Error
Report - Extension trait providing
.report()
method on concrete errors - HasKind
- Errors that can be categorized as belonging to an
ErrorKind
- HasRetry
Time - Trait for an error object that can tell us when the operation which generated it can be retried.
Functions§
- report_
and_ exit - Report the error E to stderr, and exit the program