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 6770/week @ 2024-07-23 6380/week @ 2024-07-30 5223/week @ 2024-08-06 4467/week @ 2024-08-13 3965/week @ 2024-08-20 4169/week @ 2024-08-27 4475/week @ 2024-09-03 4506/week @ 2024-09-10 3632/week @ 2024-09-17 4947/week @ 2024-09-24 4422/week @ 2024-10-01 6479/week @ 2024-10-08 6270/week @ 2024-10-15 4940/week @ 2024-10-22 5213/week @ 2024-10-29 5954/week @ 2024-11-05

23,661 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.4–6MB
~38K SLoC