Expand description
A common error handling library for the Libra project.
§Usage
// This crate must be imported as ‘failure’ in order to ensure the
// procedural derive macro for the Fail trait can function properly.
failure = { path = “../common/failure_ext”, package = “failure_ext” }
// Most of the types and macros you’ll need can be found in the prelude.
use failure::prelude::*;
Re-exports§
pub use failure::_core;
Modules§
- prelude
- Prelude module containing most commonly used types/macros this crate exports.
Macros§
- bail
- Exits a function early with an
Error. - bail_
err - Exits a function early with an
Error. - ensure
- Exits a function early with an
Errorif the condition is not satisfied. - format_
err - Constructs an
Errorusing the standard string interpolation syntax.
Structs§
- Backtrace
- A
Backtrace. - Causes
- A iterator over the causes of a
Fail - Compat
- A compatibility wrapper around an error type from this crate.
- Context
- An error with context around it.
- Error
- The
Errortype, which can contain any failure. - Sync
Failure - Wrapper for
stderrors to make themSync.
Traits§
Functions§
- err_msg
- Constructs a
Failtype from a string.