18 releases (11 breaking)

0.12.0 Aug 14, 2024
0.11.0 Jan 29, 2024
0.10.0 Dec 20, 2023
0.9.0 Nov 6, 2023
0.1.1 Mar 6, 2021

#363 in Rust patterns

Download history 11/week @ 2024-06-28 3/week @ 2024-07-05 27/week @ 2024-07-12 31/week @ 2024-07-19 61/week @ 2024-07-26 23/week @ 2024-08-02 170/week @ 2024-08-09 46/week @ 2024-08-16 27/week @ 2024-08-23 35/week @ 2024-08-30 12/week @ 2024-09-06 27/week @ 2024-09-13 60/week @ 2024-09-20 47/week @ 2024-09-27 15/week @ 2024-10-04 5/week @ 2024-10-11

131 downloads per month
Used in 14 crates

Apache-2.0

55KB
1.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

~5–14MB
~162K SLoC