Module errors

Module errors 

Source
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 operations
  • AccountOperation: operation discriminator used by AccountsError

§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§

AccountOperation
Supported account operations for structured error reporting.
AccountsError
Accounts domain errors (category-native).