|0.2.0||Feb 4, 2020|
|0.1.2||Jan 13, 2020|
#173 in Rust patterns
6,225 downloads per month
Used in 31 crates (11 directly)
Error context library with support for type-erased sources and backtraces,
targeting full support of all features on stable Rust, and with an eye towards
serializing runtime errors using
anomaly::Contexttype which impls
std::error::Errorincluding support for type-erased
anomaly::BoxErrorsources. Contexts are generic around an error
Kind, making the sources optional, and generally trying to strike a balance between typed errors and
Box-based type erasure.
- Stringly typed errors using the
anomaly::Messagetype, with a set of macros to construct these errors.
- Backtrace support using the
backtracecrate, and with it support for stable Rust where other libraries might require nightly.
- Support for serializing errors using
serde, allowing them to be submitted to exception reporting services and other structured logging systems.
Notably anomaly.rs does NOT include any sort of proc macro to define
Kind type. We recommend
thiserror for that purpose.
- Concrete (generic) types for immediate errors
- Type erasure for error sources
- No additional traits beyond
- Stringly typed
anomaly::Messagefor where enum variants are too cumbersome or error messages are coming from e.g. API responses.
- Structured logging of your errors using
anomaly.rs is an extraction of a set of patterns and boilerplate from real-world libraries and applications, most notably Abscissa.
- Rust 1.38+
Copyright © 2019-2020 iqlusion
anomaly.rs is distributed under the terms of either the MIT license or the Apache License (Version 2.0), at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.