Crate actix_error

source ·



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 is snake 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.