11 unstable releases (4 breaking)

0.5.0 Apr 15, 2022
0.4.0 Dec 8, 2021
0.3.1 Nov 5, 2021
0.2.3 Jul 5, 2021
0.1.1 Mar 6, 2021

#205 in Rust patterns

Download history 57/week @ 2022-01-28 31/week @ 2022-02-04 50/week @ 2022-02-11 34/week @ 2022-02-18 34/week @ 2022-02-25 37/week @ 2022-03-04 46/week @ 2022-03-11 43/week @ 2022-03-18 8/week @ 2022-03-25 13/week @ 2022-04-01 48/week @ 2022-04-08 53/week @ 2022-04-15 43/week @ 2022-04-22 103/week @ 2022-04-29 128/week @ 2022-05-06 212/week @ 2022-05-13

492 downloads per month
Used in less than 8 crates

Apache-2.0

9KB
185 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.3–2MB
~41K SLoC