Registry / utility / failure

failure

JSON →
library0.1.8rscratesunverified

Experimental error handling abstraction providing a unified error type and derive macro.

# Cargo.toml [dependencies] failure = "0.1.8"
INSTALL
IMPORT
SIG · FAILURE
F
failure
utilityrustv0.1.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Fail
use failure::Fail;

Defines a custom error type using the Fail derive macro.

use failure::Fail; #[derive(Fail, Debug)] pub enum MyError { #[fail(display = "An error occurred: {}", _0)] Generic(String), } fn main() { let err = MyError::Generic("something went wrong".into()); println!("{}", err); }
Debug
Known issues
breakingCrate is deprecated; consider using `anyhow` or `thiserror` instead.
fix
Replace `failure` with `anyhow` for application errors or `thiserror` for library errors.
affects: >=0.1.0
Upgrade
Version history
0.1.8latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
failure — cargo add failure · libregistry