pub enum RedeemError {
InvalidInput {
reason: RedemptionFailReason,
public: PublicRedemptionError,
},
RateLimited {
public: PublicRedemptionError,
},
NotRedeemable {
reason: RedemptionFailReason,
public: PublicRedemptionError,
},
ClaimLost {
public: PublicRedemptionError,
},
Internal {
cause: String,
public: PublicRedemptionError,
},
}Expand description
Why a code redemption flow failed (RFC-013 §10.3, RFC-012).
Carries the internal reason alongside the public-safe error so callers can log the internal cause without showing it to users.
Variants§
InvalidInput
Input validation or normalization failed before any store access.
Fields
reason: RedemptionFailReasonInternal reason (log, do not display).
public: PublicRedemptionErrorPublic-safe mapping.
RateLimited
Rate-limit threshold exceeded before lookup.
Fields
public: PublicRedemptionErrorPublic-safe mapping.
NotRedeemable
No redeemable record found, or the record was expired/used/revoked.
Fields
reason: RedemptionFailReasonInternal reason (log, do not display).
public: PublicRedemptionErrorPublic-safe mapping (always InvalidOrExpired).
ClaimLost
The atomic claim was lost to a concurrent caller.
Fields
public: PublicRedemptionErrorPublic-safe mapping.
Internal
A transient store or key failure prevented the operation.
Fields
public: PublicRedemptionErrorPublic-safe mapping.
Implementations§
Source§impl RedeemError
impl RedeemError
Sourcepub fn public(&self) -> &PublicRedemptionError
pub fn public(&self) -> &PublicRedemptionError
The public-safe error to return to callers / map to HTTP responses.
Trait Implementations§
Source§impl Debug for RedeemError
impl Debug for RedeemError
Source§impl Display for RedeemError
impl Display for RedeemError
Source§impl Error for RedeemError
impl Error for RedeemError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()