13 unstable releases (6 breaking)

0.7.0 Jan 15, 2023
0.6.0 May 30, 2022
0.5.0 Apr 15, 2022
0.4.0 Dec 8, 2021
0.1.1 Mar 6, 2021

#344 in Rust patterns

Download history 45/week @ 2022-11-24 38/week @ 2022-12-01 100/week @ 2022-12-08 20/week @ 2022-12-15 32/week @ 2022-12-22 34/week @ 2022-12-29 35/week @ 2023-01-05 67/week @ 2023-01-12 34/week @ 2023-01-19 36/week @ 2023-01-26 44/week @ 2023-02-02 59/week @ 2023-02-09 109/week @ 2023-02-16 253/week @ 2023-02-23 23/week @ 2023-03-02 11/week @ 2023-03-09

408 downloads per month
Used in 8 crates

Apache-2.0

115KB
2.5K SLoC

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

~3.5–8.5MB
~138K SLoC