20 releases (12 breaking)
| 0.13.1 | Feb 4, 2026 |
|---|---|
| 0.12.0 | Aug 14, 2024 |
| 0.11.0 | Jan 29, 2024 |
| 0.10.0 | Dec 20, 2023 |
| 0.1.1 | Mar 6, 2021 |
#1400 in Rust patterns
56 downloads per month
Used in 14 crates
55KB
1.5K
SLoC
Provides common error types and associated convenience methods for TinyChain.
This crate is a part of TinyChain: http://github.com/haydnv/tinychain
This crate is used internally by TinyChain. It provides a generic error type TCError which can be mapped to common HTTP error codes and supports serialization and deserialization with destream.
Example:
use tc_error::*;
fn expect_true(value: bool) -> TCResult<()> {
if value {
Ok(())
} else {
Err(TCError::bad_request("expected true but found", value))
}
}
assert_eq!(expect_true(true), Ok(()));
For more information on TinyChain, see: http://github.com/haydnv/tinychain
Dependencies
~2.1–6MB
~126K SLoC