pub enum CoreError {
Show 50 variants
Database(String),
Validation(String),
NotFound(String),
InsufficientBalance {
required: Decimal,
available: Decimal,
},
TokenExists(String),
InvalidCurveParams,
CircuitBreakerTriggered,
SlippageExceeded {
expected: Decimal,
actual: Decimal,
},
OrderExpired,
TokenPaused,
ReputationTooLow {
required: Decimal,
current: Decimal,
},
MaxSupplyReached,
Unauthorized,
Serialization(String),
Calculation(String),
OrderNotFound(Uuid),
InvalidOrderQuantity(String),
InvalidPrice(String),
OrderAlreadyFilled,
OrderAlreadyCancelled,
InsufficientLiquidity(String),
PriceImpactTooHigh {
impact: Decimal,
max_impact: Decimal,
},
MarketClosed,
TradingHalted(Uuid),
PositionLimitExceeded {
current: Decimal,
maximum: Decimal,
},
DailyTradingLimitExceeded {
traded: Decimal,
limit: Decimal,
},
ExcessiveLeverage {
ratio: Decimal,
max_ratio: Decimal,
},
MarginCall {
equity: Decimal,
maintenance: Decimal,
},
PaymentNotFound(Uuid),
PaymentAlreadyConfirmed,
PaymentExpired,
InsufficientConfirmations {
required: u32,
current: u32,
},
KycRequired,
KycPending,
KycRejected(String),
CommitmentNotFound(Uuid),
CommitmentAlreadyVerified,
CommitmentDeadlinePassed,
RateLimitExceeded {
retry_after: u64,
},
TooManyRequests(Uuid),
ResourceLocked(String),
OptimisticLockFailed,
DeadlockDetected,
Configuration(String),
FeatureNotEnabled(String),
InvalidState(String),
AlreadyExists(String),
InvalidAmount,
InvalidBridgeRoute,
BridgeNotSupported,
}Variants§
Database(String)
Validation(String)
NotFound(String)
InsufficientBalance
TokenExists(String)
InvalidCurveParams
CircuitBreakerTriggered
SlippageExceeded
OrderExpired
TokenPaused
ReputationTooLow
MaxSupplyReached
Serialization(String)
Calculation(String)
OrderNotFound(Uuid)
InvalidOrderQuantity(String)
InvalidPrice(String)
OrderAlreadyFilled
OrderAlreadyCancelled
InsufficientLiquidity(String)
PriceImpactTooHigh
MarketClosed
TradingHalted(Uuid)
PositionLimitExceeded
DailyTradingLimitExceeded
ExcessiveLeverage
MarginCall
PaymentNotFound(Uuid)
PaymentAlreadyConfirmed
PaymentExpired
InsufficientConfirmations
KycRequired
KycPending
KycRejected(String)
CommitmentNotFound(Uuid)
CommitmentAlreadyVerified
CommitmentDeadlinePassed
RateLimitExceeded
TooManyRequests(Uuid)
ResourceLocked(String)
OptimisticLockFailed
DeadlockDetected
Configuration(String)
FeatureNotEnabled(String)
InvalidState(String)
AlreadyExists(String)
InvalidAmount
InvalidBridgeRoute
BridgeNotSupported
Implementations§
Source§impl CoreError
impl CoreError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable (e.g., for retry logic)
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if error is a client error (4xx)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if error is a server error (5xx)
Sourcepub fn status_code(&self) -> u16
pub fn status_code(&self) -> u16
Get HTTP status code for this error
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for CoreError
impl RefUnwindSafe for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl UnwindSafe for CoreError
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
Mutably borrows from an owned value. Read more
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>
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 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>
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