13 releases

0.1.12 Nov 11, 2023
0.1.10 Oct 18, 2023
0.1.9 Jul 27, 2023
0.1.8 Mar 26, 2023
0.1.6 Mar 12, 2022

#662 in Rust patterns

Download history 5178/week @ 2024-08-05 4776/week @ 2024-08-12 4182/week @ 2024-08-19 4044/week @ 2024-08-26 4552/week @ 2024-09-02 4597/week @ 2024-09-09 3309/week @ 2024-09-16 4958/week @ 2024-09-23 4512/week @ 2024-09-30 5913/week @ 2024-10-07 6793/week @ 2024-10-14 4728/week @ 2024-10-21 5367/week @ 2024-10-28 6105/week @ 2024-11-04 5065/week @ 2024-11-11 5505/week @ 2024-11-18

22,341 downloads per month
Used in 18 crates (3 directly)

Apache-2.0

20KB
442 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–6MB
~37K SLoC