Expand description
Hashing-category native errors.
This module defines category-native error types for hashing and verification, used directly in handlers, services, and middleware for hashing, password verification, and secret management flows.
§Overview
HashingError: category-native error enum for hashing/verificationHashingOperation: operation discriminator used byHashingError
§Examples
Construct a hashing error with algorithm context:
use axum_gate::hashing::{HashingError, HashingOperation};
let err = HashingError::with_algorithm(
HashingOperation::Hash,
"argon2 hashing failed",
"argon2id",
);
// Utility methods from the unified trait
use axum_gate::errors::UserFriendlyError;
assert!(err.user_message().contains("security processing system"));
assert!(err.developer_message().contains("Hash operation hash failed"));
assert!(err.support_code().starts_with("HASH-HASH"));Construct a verification failure where retry is possible:
use axum_gate::hashing::{HashingError, HashingOperation};
use axum_gate::errors::UserFriendlyError;
let err = HashingError::with_context(
HashingOperation::Verify,
"password verification failed",
Some("argon2id".into()),
Some("$argon2id$v=19$...".into()),
);
assert!(err.is_retryable());Enums§
- Hashing
Error - Hashing-category native errors (hashing and verification).
- Hashing
Operation - Hashing operation identifiers used for structured error reporting.