arbos/retryables/
error.rs

1use arb_storage::StorageError;
2
3use crate::util::BalanceError;
4
5/// Errors raised by the retryable ticket subsystem.
6#[derive(Clone, thiserror::Error, Debug)]
7pub enum RetryableError {
8    /// Underlying storage failure.
9    #[error(transparent)]
10    Storage(#[from] StorageError),
11
12    /// `keepalive` was asked to push a ticket's expiry past the maximum
13    /// permitted window.
14    #[error("timeout too far into the future")]
15    TimeoutTooFarFuture,
16
17    /// No retryable ticket exists with the given id.
18    #[error("ticket not found")]
19    NoTicketWithId,
20
21    /// `cancel` was called by someone other than the ticket's beneficiary.
22    #[error("only the beneficiary may cancel a retryable")]
23    NotBeneficiary,
24
25    /// A retryable attempted to operate on itself (e.g. redeem from its own
26    /// execution context).
27    #[error("retryable cannot modify itself")]
28    SelfModifyingRetryable,
29
30    /// The transfer callback rejected the escrow movement performed while
31    /// processing a retryable.
32    #[error(transparent)]
33    Balance(#[from] BalanceError),
34}