20 releases (12 breaking)

0.13.1 Feb 4, 2026
0.12.0 Aug 14, 2024
0.11.0 Jan 29, 2024
0.10.0 Dec 20, 2023
0.1.1 Mar 6, 2021

#1400 in Rust patterns

Download history 8/week @ 2025-12-30 4/week @ 2026-01-06 6/week @ 2026-01-20 16/week @ 2026-01-27 6/week @ 2026-02-03 7/week @ 2026-02-17 9/week @ 2026-02-24 4/week @ 2026-03-03 9/week @ 2026-03-10 15/week @ 2026-03-17 3/week @ 2026-03-24 5/week @ 2026-03-31 24/week @ 2026-04-07 24/week @ 2026-04-14

56 downloads per month
Used in 14 crates

Apache-2.0

55KB
1.5K SLoC

Provides common error types and associated convenience methods for TinyChain.

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


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

Dependencies

~2.1–6MB
~126K SLoC