14 releases

new 0.1.13 Jan 7, 2025
0.1.12 Nov 11, 2023
0.1.10 Oct 18, 2023
0.1.9 Jul 27, 2023
0.1.6 Mar 12, 2022

#667 in Rust patterns

Download history 4451/week @ 2024-09-20 4876/week @ 2024-09-27 5020/week @ 2024-10-04 7284/week @ 2024-10-11 5124/week @ 2024-10-18 5174/week @ 2024-10-25 5720/week @ 2024-11-01 5391/week @ 2024-11-08 5562/week @ 2024-11-15 6011/week @ 2024-11-22 5706/week @ 2024-11-29 5740/week @ 2024-12-06 6007/week @ 2024-12-13 5887/week @ 2024-12-20 4337/week @ 2024-12-27 7767/week @ 2025-01-03

25,081 downloads per month
Used in 20 crates (5 directly)

Apache-2.0

21KB
460 lines

AnyError

AnyError is a serializable casing for Error.

AnyError can be employed to transform other Error types into a serializable Error for transmission, preserving most of the essential information.

let err = fmt::Error {};
let e = AnyError::new(&err)
            .add_context(|| "running test")
            .add_context(|| "developing new feature");
println!("{:#}", e);

The above code will print error description with context:

core::fmt::Error: an error occurred when formatting an argument
    while: running test
    while: developing new feature

Dependencies

~0.3–6.5MB
~38K SLoC