Crates.io | anyerror |
lib.rs | anyerror |
version | 0.1.12 |
source | src |
created_at | 2022-01-09 12:44:36.271054 |
updated_at | 2023-11-11 09:07:41.620975 |
description | A type of any error for transport |
homepage | https://github.com/drmingdrmer/anyerror |
repository | https://github.com/drmingdrmer/anyerror |
max_upload_size | |
id | 510782 |
size | 36,367 |
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