Expand description
Account-category native errors.
This module provides category-native error types for the Accounts domain, used directly in handlers, services, and repositories.
§Overview
AccountsError: domain-specific error enum for account operationsAccountOperation: operation discriminator used byAccountsError
§Examples
Basic construction and user-facing message extraction:
use axum_gate::accounts::{AccountsError, AccountOperation};
use axum_gate::errors::UserFriendlyError;
let err = AccountsError::operation(
AccountOperation::Create,
"failed to persist account",
Some("user-123".into()),
);
assert!(err.user_message().contains("couldn't create your account"));
assert!(err.developer_message().contains("Account operation create failed"));
assert!(err.support_code().starts_with("ACCT-"));Enums§
- Account
Operation - Supported account operations for structured error reporting.
- Accounts
Error - Accounts domain errors (category-native).