9 releases

0.3.1 Nov 5, 2021
0.3.0 Oct 1, 2021
0.2.5 Sep 7, 2021
0.2.4 Aug 3, 2021
0.1.0 Feb 21, 2021

#263 in Rust patterns

Download history 14/week @ 2021-08-10 10/week @ 2021-08-17 6/week @ 2021-08-24 1/week @ 2021-08-31 26/week @ 2021-09-07 6/week @ 2021-09-14 2/week @ 2021-09-21 26/week @ 2021-09-28 4/week @ 2021-10-05 17/week @ 2021-10-12 5/week @ 2021-10-19 4/week @ 2021-10-26 31/week @ 2021-11-02 14/week @ 2021-11-09 8/week @ 2021-11-16 5/week @ 2021-11-23

58 downloads per month
Used in less than 7 crates

Apache-2.0

9KB
188 lines

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


lib.rs:

Provides common error types and associated convenience methods for TinyChain.

This crate is a part of TinyChain: http://github.com/haydnv/tinychain

Dependencies

~1.4–2.4MB
~50K SLoC