pub enum TallyError {
Show 23 variants
Anchor(Error),
AnchorClient(Box<ClientError>),
Solana(ParsePubkeyError),
SplToken(TokenError),
Program(ProgramError),
Json(Error),
Generic(String),
ParseError(String),
InvalidPda(String),
InvalidTokenProgram {
expected: String,
found: String,
},
AccountNotFound(String),
InsufficientFunds {
required: u64,
available: u64,
},
InvalidSubscriptionState(String),
TokenProgramDetectionFailed {
mint: String,
},
RpcError(String),
InvalidSubscriberTokenAccount,
InvalidMerchantTreasuryAccount,
InvalidPlatformTreasuryAccount,
InvalidUsdcMint,
MerchantNotFound,
PlanNotFound,
SubscriptionNotFound,
ConfigNotFound,
}Expand description
Error types that can occur when using the Tally SDK
Variants§
Anchor(Error)
Error from Anchor framework
AnchorClient(Box<ClientError>)
Error from Anchor client
Solana(ParsePubkeyError)
Error from Solana SDK
SplToken(TokenError)
Error from SPL Token
Program(ProgramError)
Error from Solana Program
Json(Error)
Error from serde JSON
Generic(String)
Generic error with message
ParseError(String)
Event parsing error
InvalidPda(String)
Invalid PDA computation
InvalidTokenProgram
Invalid token program
AccountNotFound(String)
Account not found
InsufficientFunds
Insufficient funds
InvalidSubscriptionState(String)
Invalid subscription state
TokenProgramDetectionFailed
Token program detection failed
RpcError(String)
RPC error for blockchain queries
InvalidSubscriberTokenAccount
Invalid subscriber token account (program error 6012)
InvalidMerchantTreasuryAccount
Invalid merchant treasury token account (program error 6013)
InvalidPlatformTreasuryAccount
Invalid platform treasury token account (program error 6014)
InvalidUsdcMint
Invalid USDC mint account (program error 6015)
MerchantNotFound
Merchant account not found or invalid (program error 6016)
PlanNotFound
Subscription plan not found or invalid (program error 6017)
SubscriptionNotFound
Subscription not found or invalid (program error 6018)
ConfigNotFound
Global configuration account not found or invalid (program error 6019)
Implementations§
Source§impl TallyError
impl TallyError
Sourcepub fn from_anchor_error(anchor_error: Error) -> Self
pub fn from_anchor_error(anchor_error: Error) -> Self
Map program error codes to specific TallyError variants
This function takes an Anchor error and attempts to map it to a more specific
TallyError variant based on the error code. If no specific mapping exists,
it returns the original Anchor error wrapped in TallyError::Anchor.
§Arguments
anchor_error- The Anchor error to map
§Returns
TallyError- The mapped specific error variant or generic Anchor error
Sourcepub fn from_anchor_client_error(client_error: ClientError) -> Self
pub fn from_anchor_client_error(client_error: ClientError) -> Self
Trait Implementations§
Source§impl Debug for TallyError
impl Debug for TallyError
Source§impl Display for TallyError
impl Display for TallyError
Source§impl Error for TallyError
impl Error for TallyError
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
Source§impl From<&str> for TallyError
impl From<&str> for TallyError
Source§impl From<ClientError> for TallyError
impl From<ClientError> for TallyError
Source§fn from(error: ClientError) -> Self
fn from(error: ClientError) -> Self
Source§impl From<Error> for TallyError
impl From<Error> for TallyError
Source§impl From<Error> for TallyError
impl From<Error> for TallyError
Source§impl From<Error> for TallyError
impl From<Error> for TallyError
Source§impl From<ParsePubkeyError> for TallyError
impl From<ParsePubkeyError> for TallyError
Source§fn from(source: ParsePubkeyError) -> Self
fn from(source: ParsePubkeyError) -> Self
Source§impl From<ProgramError> for TallyError
impl From<ProgramError> for TallyError
Source§fn from(source: ProgramError) -> Self
fn from(source: ProgramError) -> Self
Source§impl From<ProgramError> for TallyError
impl From<ProgramError> for TallyError
Source§fn from(error: ProgramError) -> Self
fn from(error: ProgramError) -> Self
Source§impl From<String> for TallyError
impl From<String> for TallyError
Source§impl From<TokenError> for TallyError
impl From<TokenError> for TallyError
Source§fn from(source: TokenError) -> Self
fn from(source: TokenError) -> Self
Auto Trait Implementations§
impl Freeze for TallyError
impl !RefUnwindSafe for TallyError
impl Send for TallyError
impl Sync for TallyError
impl Unpin for TallyError
impl !UnwindSafe for TallyError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.