Crate actix_error
source ·Structs§
- Configuration for formatting.
- An HTTP status code (
status-code
in RFC 7230 et al.).
Traits§
?
formatting.- Format trait for an empty format,
{}
.
Derive Macros§
- This derive macro is used to convert an enum into an ApiError.
You can use it by adding the#[derive(AsApiError)]
attribute to your enum.
By default, the kind issnake case
.
#[error(kind = "your_message_id")]
attribute to the variant.
You can also add a custom code to the error by adding the#[error(code = 400)]
attribute to the variant.
The following status are available and return the corresponding status code: - Derive macro generating an impl of the trait
Debug
.