tc-error

Crates.iotc-error
lib.rstc-error
version0.11.0
sourcesrc
created_at2021-02-21 00:58:44.741054
updated_at2024-01-29 12:28:11.806167
descriptionTinyChain's generic error struct
homepage
repositoryhttps://github.com/haydnv/tinychain.git
max_upload_size
id358267
size14,710
Haydn Vestal (haydnv)

documentation

README

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

Commit count: 3128

cargo fmt