17 releases (10 breaking)

0.11.0 Jan 29, 2024
0.10.0 Dec 20, 2023
0.9.0 Nov 6, 2023
0.7.0 Jan 15, 2023
0.1.1 Mar 6, 2021

#738 in Rust patterns

Download history 29/week @ 2024-03-11 34/week @ 2024-03-18 27/week @ 2024-03-25 114/week @ 2024-04-01 170/week @ 2024-04-08 18/week @ 2024-04-15 24/week @ 2024-04-22 17/week @ 2024-04-29 17/week @ 2024-05-06 18/week @ 2024-05-13 15/week @ 2024-05-20 41/week @ 2024-05-27 28/week @ 2024-06-03 22/week @ 2024-06-10 16/week @ 2024-06-17 25/week @ 2024-06-24

92 downloads per month
Used in 13 crates

Apache-2.0

160KB
4K 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

~11–15MB
~274K SLoC