pub enum OdosErrorCode {
Show 53 variants
ApiError,
NoViablePath,
AlgoValidationError,
AlgoConnectionError,
AlgoTimeout,
AlgoInternal,
InternalServiceError,
ConfigInternal,
ConfigConnectionError,
ConfigTimeout,
TxnAssemblyInternal,
TxnAssemblyConnectionError,
TxnAssemblyTimeout,
ChainDataInternal,
ChainDataConnectionError,
ChainDataTimeout,
PricingInternal,
PricingConnectionError,
PricingTimeout,
GasInternal,
GasConnectionError,
GasTimeout,
GasUnavailable,
InvalidRequest,
InvalidChainId,
InvalidInputTokens,
InvalidOutputTokens,
InvalidUserAddr,
BlockedUserAddr,
TooSlippery,
SameInputOutput,
MultiZapOutput,
InvalidTokenCount,
InvalidTokenAddr,
NonIntegerTokenAmount,
NegativeTokenAmount,
SameInputOutputTokens,
TokenBlacklisted,
InvalidTokenProportions,
TokenRoutingUnavailable,
InvalidReferralCode,
InvalidTokenAmount,
NonStringTokenAmount,
InvalidAssemblyRequest,
InvalidAssemblyUserAddr,
InvalidReceiverAddr,
InvalidSwapRequest,
UserAddrRequired,
InternalError,
SwapUnavailable,
PriceCheckFailure,
DefaultGasFailure,
Unknown(u16),
}Expand description
Strongly-typed Odos API error codes
Each variant represents a specific error condition documented by Odos. Error codes are grouped by category (1XXX-5XXX ranges).
Variants§
ApiError
General API error (1000)
NoViablePath
No viable routing path found (2000)
AlgoValidationError
Algorithm validation error (2400)
AlgoConnectionError
Algorithm connection error (2997)
AlgoTimeout
Algorithm timeout (2998)
AlgoInternal
Algorithm internal error (2999)
InternalServiceError
Internal service error (3000)
ConfigInternal
Config service internal error (3100)
ConfigConnectionError
Config service connection error (3101)
ConfigTimeout
Config service timeout (3102)
TxnAssemblyInternal
Transaction assembly internal error (3110)
TxnAssemblyConnectionError
Transaction assembly connection error (3111)
TxnAssemblyTimeout
Transaction assembly timeout (3112)
ChainDataInternal
Chain data internal error (3120)
ChainDataConnectionError
Chain data connection error (3121)
ChainDataTimeout
Chain data timeout (3122)
PricingInternal
Pricing service internal error (3130)
PricingConnectionError
Pricing service connection error (3131)
PricingTimeout
Pricing service timeout (3132)
GasInternal
Gas service internal error (3140)
GasConnectionError
Gas service connection error (3141)
GasTimeout
Gas service timeout (3142)
Gas data unavailable (3143)
InvalidRequest
Invalid request (4000)
InvalidChainId
Invalid chain ID (4001)
InvalidInputTokens
Invalid input tokens (4002)
InvalidOutputTokens
Invalid output tokens (4003)
InvalidUserAddr
Invalid user address (4004)
BlockedUserAddr
Blocked user address (4005)
TooSlippery
Slippage tolerance too high (4006)
SameInputOutput
Same token for input and output (4007)
MultiZapOutput
Multiple zap outputs not supported (4008)
InvalidTokenCount
Invalid token count (4009)
InvalidTokenAddr
Invalid token address (4010)
NonIntegerTokenAmount
Non-integer token amount (4011)
NegativeTokenAmount
Negative token amount (4012)
SameInputOutputTokens
Same tokens in input and output (4013)
TokenBlacklisted
Token is blacklisted (4014)
InvalidTokenProportions
Invalid token proportions (4015)
Token routing unavailable (4016)
InvalidReferralCode
Invalid referral code (4017)
InvalidTokenAmount
Invalid token amount (4018)
NonStringTokenAmount
Non-string token amount (4019)
InvalidAssemblyRequest
Invalid assembly request (4100)
InvalidAssemblyUserAddr
Invalid user address in assembly (4101)
InvalidReceiverAddr
Invalid receiver address (4102)
InvalidSwapRequest
Invalid swap request (4200)
UserAddrRequired
User address required (4201)
InternalError
Internal error (5000)
Swap unavailable (5001)
PriceCheckFailure
Price check failure (5002)
DefaultGasFailure
Default gas calculation failure (5003)
Unknown(u16)
Unknown error code
Implementations§
Source§impl OdosErrorCode
impl OdosErrorCode
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Get the error category
Sourcepub fn is_general_error(&self) -> bool
pub fn is_general_error(&self) -> bool
Check if this is a general API error
Sourcepub fn is_algo_error(&self) -> bool
pub fn is_algo_error(&self) -> bool
Check if this is an algorithm/quote error
Sourcepub fn is_internal_service_error(&self) -> bool
pub fn is_internal_service_error(&self) -> bool
Check if this is an internal service error
Sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Check if this is a validation error
Sourcepub fn is_internal_error(&self) -> bool
pub fn is_internal_error(&self) -> bool
Check if this is an internal error
Sourcepub fn is_no_viable_path(&self) -> bool
pub fn is_no_viable_path(&self) -> bool
Check if this specific error is no viable path
Sourcepub fn is_invalid_chain_id(&self) -> bool
pub fn is_invalid_chain_id(&self) -> bool
Check if this is an invalid chain ID error
Sourcepub fn is_blocked_user(&self) -> bool
pub fn is_blocked_user(&self) -> bool
Check if this is a blocked user address error
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if this is a timeout error (any service)
Sourcepub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Check if this is a connection error (any service)
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error indicates the request should be retried
Retryable errors include:
- Timeouts (algo, config, assembly, chain data, pricing, gas)
- Connection errors (all services)
- Internal errors (algo, services, general)
- Gas unavailable
Trait Implementations§
Source§impl Clone for OdosErrorCode
impl Clone for OdosErrorCode
Source§fn clone(&self) -> OdosErrorCode
fn clone(&self) -> OdosErrorCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OdosErrorCode
impl Debug for OdosErrorCode
Source§impl Display for OdosErrorCode
impl Display for OdosErrorCode
Source§impl From<OdosErrorCode> for u16
impl From<OdosErrorCode> for u16
Source§fn from(error_code: OdosErrorCode) -> Self
fn from(error_code: OdosErrorCode) -> Self
Source§impl From<u16> for OdosErrorCode
impl From<u16> for OdosErrorCode
Source§impl PartialEq for OdosErrorCode
impl PartialEq for OdosErrorCode
impl Copy for OdosErrorCode
impl Eq for OdosErrorCode
impl StructuralPartialEq for OdosErrorCode
Auto Trait Implementations§
impl Freeze for OdosErrorCode
impl RefUnwindSafe for OdosErrorCode
impl Send for OdosErrorCode
impl Sync for OdosErrorCode
impl Unpin for OdosErrorCode
impl UnwindSafe for OdosErrorCode
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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.