Skip to main content

SubscriptionBillingServiceError

Enum SubscriptionBillingServiceError 

Source
#[non_exhaustive]
pub enum SubscriptionBillingServiceError {
Show 31 variants Sql(Error), StorageTemporarilyUnavailable(Error), Attempt(PaymentAttemptStoreError), Application(SubscriptionEnrollmentApplicationError), HostChargeApplication(HostChargeApplicationError), HostChargeStore(HostChargeStoreError), Cancellation(SubscriptionCancellationError), Discount(SubscriptionDiscountOperationError), BillingTransaction(BillingTransactionError), BillingEvent(BillingEventWriteError), HostChargeUnavailable, IdempotencyConflict, AdmissionDenied { retry_after: Duration, }, AdmissionTimeout, AdmissionUnavailable, GatewayConfigurationChanged, GatewayResolution(GatewayResolutionError), ResolvedGatewayIdentityMismatch, GatewayMutationCooldown { scope: GatewayMutationCooldownScope, }, ReservationRejected(SubscriptionEnrollmentReservationRejection), SubmissionRejected(SubscriptionEnrollmentSubmissionRejection), HostChargeReservationRejected(HostChargeTargetRejection), HostChargeSubmissionRejected(HostChargeTargetRejection), RecoveryReservationRejected(SubscriptionRecoveryReservationRejection), RecoverySubmissionRejected(SubscriptionRecoverySubmissionRejection), RenewalReservationRejected(SubscriptionRenewalReservationRejection), PaymentMethodReplacementReservationRejected(SubscriptionPaymentMethodReplacementRejection), PaymentMethodReplacementSubmissionRejected(SubscriptionPaymentMethodReplacementSubmissionRejection), GatewayNotSubmitted(GatewayNotSubmittedError), GatewayReadiness(GatewayError), InvalidState(&'static str),
}
Expand description

Failure returned by the high-level subscription billing facade.

This covers subscriber-owned enrollment, recovery, renewal, payment-method replacement, cancellation, discount mutations, reconciliation, and the optional host-charge capability.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Sql(Error)

Generic SQL failure whose retry safety is not proven by the owning path.

§

StorageTemporarilyUnavailable(Error)

A provider-free local transaction could not acquire capacity or failed with an explicitly recognized transient SQLSTATE. Replaying the same idempotent operation after the failed transaction is discarded is safe.

§

Attempt(PaymentAttemptStoreError)

Canonical payment-attempt persistence failed.

§

Application(SubscriptionEnrollmentApplicationError)

A subscription payment outcome could not be applied atomically.

§

HostChargeApplication(HostChargeApplicationError)

A host-charge outcome could not be applied atomically.

§

HostChargeStore(HostChargeStoreError)

Canonical host-charge reservation or ledger storage failed.

§

Cancellation(SubscriptionCancellationError)

Subscriber cancellation failed.

§

Discount(SubscriptionDiscountOperationError)

Subscriber discount mutation failed.

§

BillingTransaction(BillingTransactionError)

The host-prepared billing transaction failed.

§

BillingEvent(BillingEventWriteError)

The typed event could not be appended to the host outbox.

§

HostChargeUnavailable

The optional host-charge target capability was not supplied.

§

IdempotencyConflict

The idempotency key already owns a different immutable request.

§

AdmissionDenied

Host admission denied the command with an exact retry delay.

Fields

§retry_after: Duration

Exact delay supplied by the host admission implementation.

§

AdmissionTimeout

Host admission did not complete before its bound.

§

AdmissionUnavailable

Host admission could not evaluate the command.

§

GatewayConfigurationChanged

Durable gateway authority changed after the command was prepared.

§

GatewayResolution(GatewayResolutionError)

The host could not resolve canonical gateway authority.

§

ResolvedGatewayIdentityMismatch

The resolver returned a gateway for a different canonical identity.

§

GatewayMutationCooldown

A durable account or provider cooldown stopped submission.

Fields

§scope: GatewayMutationCooldownScope

Canonical cooldown level that stopped the command.

§

ReservationRejected(SubscriptionEnrollmentReservationRejection)

Initial-enrollment reservation returned a semantic blocker.

§

SubmissionRejected(SubscriptionEnrollmentSubmissionRejection)

Initial-enrollment final admission returned a semantic blocker.

§

HostChargeReservationRejected(HostChargeTargetRejection)

Host-charge reservation returned a semantic blocker.

§

HostChargeSubmissionRejected(HostChargeTargetRejection)

Host-charge final admission returned a semantic blocker.

§

RecoveryReservationRejected(SubscriptionRecoveryReservationRejection)

Subscriber recovery reservation returned a semantic blocker.

§

RecoverySubmissionRejected(SubscriptionRecoverySubmissionRejection)

Subscriber recovery final admission returned a semantic blocker.

§

RenewalReservationRejected(SubscriptionRenewalReservationRejection)

Automatic-renewal reservation returned a semantic blocker.

§

PaymentMethodReplacementReservationRejected(SubscriptionPaymentMethodReplacementRejection)

Payment-method replacement reservation returned a semantic blocker.

§

PaymentMethodReplacementSubmissionRejected(SubscriptionPaymentMethodReplacementSubmissionRejection)

Payment-method replacement final admission returned a semantic blocker.

§

GatewayNotSubmitted(GatewayNotSubmittedError)

Gateway adaptation proved that the mutation was not submitted.

§

GatewayReadiness(GatewayError)

The gateway readiness query failed before mutation submission.

This error does not by itself prove that no durable attempt exists. If readiness fails after reservation, transient unavailability leaves the prepared attempt retryable, while a determinate readiness failure may terminalize it with an exact resolution code before returning this error. Replaying the same command and idempotency key recovers that canonical result before admission, resolution, or provider I/O.

§

InvalidState(&'static str)

Durable canonical state violated an invariant required by the facade.

Implementations§

Source§

impl SubscriptionBillingServiceError

Source

pub const fn disposition(&self) -> SubscriptionBillingServiceErrorDisposition

Returns the stable, conservative operational category for this error.

The category intentionally does not expose provider diagnostics, payment values, or durable identifiers.

Source

pub const fn is_retryable(&self) -> bool

Returns whether it is safe to resubmit the same idempotent command.

A true result means only that Syrup Rail can safely accept another submission of that unchanged command and idempotency key. It does not promise that the next call will perform another payment; it may return a canonical terminal result. Do not create a new command or idempotency key merely because this returns true. Inspect the canonical result before deciding whether a later payment needs a newly issued key.

Source

pub const fn is_conflict(&self) -> bool

Returns whether the command conflicts with an existing idempotency or authority snapshot.

Conflicts are not retryable as-is; reload current authority or reconcile the existing idempotency key before constructing another command.

Source

pub const fn retry_after(&self) -> Option<Duration>

Returns an exact retry delay when the service was given one.

None does not imply that the error is non-retryable. For example, gateway/account cooldowns are temporarily unavailable but do not carry an exact delay that this API can safely fabricate.

Trait Implementations§

Source§

impl Debug for SubscriptionBillingServiceError

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SubscriptionBillingServiceError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SubscriptionBillingServiceError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BillingEventWriteError> for SubscriptionBillingServiceError

Source§

fn from(source: BillingEventWriteError) -> Self

Converts to this type from the input type.
Source§

impl From<BillingTransactionError> for SubscriptionBillingServiceError

Source§

fn from(source: BillingTransactionError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SubscriptionBillingServiceError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<GatewayResolutionError> for SubscriptionBillingServiceError

Source§

fn from(source: GatewayResolutionError) -> Self

Converts to this type from the input type.
Source§

impl From<HostChargeApplicationError> for SubscriptionBillingServiceError

Source§

fn from(source: HostChargeApplicationError) -> Self

Converts to this type from the input type.
Source§

impl From<HostChargeStoreError> for SubscriptionBillingServiceError

Source§

fn from(source: HostChargeStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<PaymentAttemptStoreError> for SubscriptionBillingServiceError

Source§

fn from(source: PaymentAttemptStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<SubscriptionCancellationError> for SubscriptionBillingServiceError

Source§

fn from(error: SubscriptionCancellationError) -> Self

Converts to this type from the input type.
Source§

impl From<SubscriptionDiscountOperationError> for SubscriptionBillingServiceError

Source§

fn from(error: SubscriptionDiscountOperationError) -> Self

Converts to this type from the input type.
Source§

impl From<SubscriptionEnrollmentApplicationError> for SubscriptionBillingServiceError

Source§

fn from(source: SubscriptionEnrollmentApplicationError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more