alien-error-derive 1.2.1

Procedural macros for alien-error
Documentation

Procedural macro that powers alien-error.

Usage:

use alien_error::AlienErrorData;
#[derive(Debug, AlienErrorData)]
enum MyError {
    #[error(code = "SOMETHING_WRONG", message = "something went wrong", retryable = "false", internal = "false", http_status_code = 420)]
    Oops,
}

The error(...) attribute supplies compile-time metadata: • code – short machine friendly identifier (defaults to variant name). • message – human-readable error message with field interpolation. • retryable – flag set to true if the operation can be retried. • internal – flag set to true if this error should not be exposed. • http_status_code – HTTP status code for this error (defaults to 500).

The macro also auto-implements AlienErrorData including a context() method that serialises variant fields into a JSON map for diagnostic payloads.