api-error 0.1.3

A derive macro for attaching HTTP status codes and user-facing messages to Rust error types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use api_error::ApiError;

#[derive(Debug, thiserror::Error, ApiError)]
enum MyError {
    #[error("some error")]
    #[api_error(transparent, message = "Cannot be combined")]
    Transparent(InnerError),
}

#[derive(Debug, thiserror::Error, ApiError)]
#[error("this is an inner error!")]
struct InnerError;

fn main() {}