pub enum EMSError {
Show 19 variants
ConnectionError(SmartString),
AuthenticationError(SmartString),
OrderSubmissionError(SmartString),
OrderCancellationError(SmartString),
OrderModificationError(SmartString),
RateLimitExceeded {
message: SmartString,
retry_after_ms: Option<u64>,
},
InvalidOrderParameters(SmartString),
InsufficientBalance(SmartString),
InstrumentNotFound(SmartString),
ExchangeApiError {
exchange: SmartString,
code: i32,
message: SmartString,
details: Option<SmartString>,
},
OperationNotSupported {
exchange: SmartString,
operation: SmartString,
},
UnknownError(SmartString),
JsonError(Error),
JsonParsingError {
context: SmartString,
message: SmartString,
},
IoError(Error),
NetworkError(SmartString),
Timeout {
duration_ms: u64,
context: SmartString,
},
WebSocketError(SmartString),
WebSocketFrameError(String),
}Expand description
Errors that can occur in the Execution Management System
Variants§
ConnectionError(SmartString)
Connection errors with the exchange
AuthenticationError(SmartString)
Authentication errors
OrderSubmissionError(SmartString)
Order submission errors
OrderCancellationError(SmartString)
Order cancellation errors
OrderModificationError(SmartString)
Order modification errors
RateLimitExceeded
Rate limiting errors
Fields
message: SmartStringError message describing the rate limit violation
InvalidOrderParameters(SmartString)
Invalid order parameters
InsufficientBalance(SmartString)
Insufficient balance errors
InstrumentNotFound(SmartString)
Instrument not found errors
ExchangeApiError
Exchange API error with detailed information
Fields
exchange: SmartStringName of the exchange that generated the error
message: SmartStringError message from the exchange
OperationNotSupported
Operation not supported by exchange
Fields
exchange: SmartStringName of the exchange that doesn’t support the operation
operation: SmartStringDescription of the unsupported operation
UnknownError(SmartString)
Unknown errors
JsonError(Error)
Error with JSON serialization/deserialization
JsonParsingError
JSON parsing error with context
Fields
context: SmartStringContext where the JSON parsing error occurred
message: SmartStringDetailed error message
IoError(Error)
General I/O errors
NetworkError(SmartString)
Network/HTTP errors
Timeout
Timeout errors
Fields
context: SmartStringContext or operation that timed out
WebSocketError(SmartString)
WebSocket errors
WebSocketFrameError(String)
WebSocket frame errors from yawc
Implementations§
Source§impl EMSError
Helper functions for common error scenarios
impl EMSError
Helper functions for common error scenarios
Sourcepub fn connection<S: Into<SmartString>>(msg: S) -> Self
pub fn connection<S: Into<SmartString>>(msg: S) -> Self
Create a connection error with a descriptive message
Sourcepub fn auth<S: Into<SmartString>>(msg: S) -> Self
pub fn auth<S: Into<SmartString>>(msg: S) -> Self
Create an authentication error with a descriptive message
Sourcepub fn order_submission<S: Into<SmartString>>(msg: S) -> Self
pub fn order_submission<S: Into<SmartString>>(msg: S) -> Self
Create an order submission error with a descriptive message
Sourcepub fn order_cancellation<S: Into<SmartString>>(msg: S) -> Self
pub fn order_cancellation<S: Into<SmartString>>(msg: S) -> Self
Create an order cancellation error with a descriptive message
Sourcepub fn order_modification<S: Into<SmartString>>(msg: S) -> Self
pub fn order_modification<S: Into<SmartString>>(msg: S) -> Self
Create an order modification error with a descriptive message
Sourcepub fn rate_limit<S: Into<SmartString>>(
msg: S,
retry_after_ms: Option<u64>,
) -> Self
pub fn rate_limit<S: Into<SmartString>>( msg: S, retry_after_ms: Option<u64>, ) -> Self
Create a rate limit error
Sourcepub fn invalid_params<S: Into<SmartString>>(msg: S) -> Self
pub fn invalid_params<S: Into<SmartString>>(msg: S) -> Self
Create an invalid order parameters error
Sourcepub fn insufficient_balance<S: Into<SmartString>>(msg: S) -> Self
pub fn insufficient_balance<S: Into<SmartString>>(msg: S) -> Self
Create an insufficient balance error
Sourcepub fn instrument_not_found<S: Into<SmartString>>(symbol: S) -> Self
pub fn instrument_not_found<S: Into<SmartString>>(symbol: S) -> Self
Create an instrument not found error
Sourcepub fn exchange_api<S1, S2, S3>(
exchange: S1,
code: i32,
message: S2,
details: Option<S3>,
) -> Self
pub fn exchange_api<S1, S2, S3>( exchange: S1, code: i32, message: S2, details: Option<S3>, ) -> Self
Create an exchange API error
Sourcepub fn not_supported<S1, S2>(exchange: S1, operation: S2) -> Self
pub fn not_supported<S1, S2>(exchange: S1, operation: S2) -> Self
Create an operation not supported error
Sourcepub fn timeout<S: Into<SmartString>>(duration_ms: u64, context: S) -> Self
pub fn timeout<S: Into<SmartString>>(duration_ms: u64, context: S) -> Self
Create a timeout error
Sourcepub fn json_parse<S1, S2>(context: S1, message: S2) -> Self
pub fn json_parse<S1, S2>(context: S1, message: S2) -> Self
Create a JSON parsing error with context
Sourcepub fn channel_send_error(err: &impl Display) -> Self
pub fn channel_send_error(err: &impl Display) -> Self
Optimized error creation helpers that avoid temporary String allocations
These use write! directly into SmartString for better performance
Create a channel send error with optimized formatting
Sourcepub fn json_error(err: &impl Display) -> Self
pub fn json_error(err: &impl Display) -> Self
Create a JSON error with optimized formatting
Sourcepub fn connection_failed(err: &impl Display) -> Self
pub fn connection_failed(err: &impl Display) -> Self
Create a connection failed error with optimized formatting
Sourcepub fn http_status_error(status: u16) -> SmartString
pub fn http_status_error(status: u16) -> SmartString
Create an HTTP status error with optimized formatting
Sourcepub fn rate_limit_with_exchange(exchange: &str, msg: &str) -> SmartString
pub fn rate_limit_with_exchange(exchange: &str, msg: &str) -> SmartString
Create a rate limit error with optimized formatting
Sourcepub fn auth_failed_error(exchange: &str) -> Self
pub fn auth_failed_error(exchange: &str) -> Self
Create an authentication failed error with optimized formatting
Sourcepub fn access_forbidden_error(exchange: &str) -> Self
pub fn access_forbidden_error(exchange: &str) -> Self
Create an access forbidden error with optimized formatting
Sourcepub fn rate_limit_exceeded_error(exchange: &str) -> SmartString
pub fn rate_limit_exceeded_error(exchange: &str) -> SmartString
Create a rate limit exceeded error with optimized formatting
Sourcepub fn internal_server_error(exchange: &str) -> Self
pub fn internal_server_error(exchange: &str) -> Self
Create an internal server error with optimized formatting
Create a service unavailable error with optimized formatting
Sourcepub fn gateway_timeout_error(exchange: &str) -> SmartString
pub fn gateway_timeout_error(exchange: &str) -> SmartString
Create a gateway timeout error with optimized formatting
Sourcepub fn auth_exchange_failed(exchange: &str, err: &impl Display) -> Self
pub fn auth_exchange_failed(exchange: &str, err: &impl Display) -> Self
Create an auth error with optimized formatting for exchange auth failures
Sourcepub fn auth_invalid_header_name(err: &impl Display) -> Self
pub fn auth_invalid_header_name(err: &impl Display) -> Self
Create an auth error with optimized formatting for header name errors
Sourcepub fn auth_invalid_header_value(err: &impl Display) -> Self
pub fn auth_invalid_header_value(err: &impl Display) -> Self
Create an auth error with optimized formatting for header value errors
Sourcepub const fn is_recoverable(&self) -> bool
pub const fn is_recoverable(&self) -> bool
Check if error is recoverable (e.g., temporary network issues)
Sourcepub const fn retry_delay_ms(&self) -> Option<u64>
pub const fn retry_delay_ms(&self) -> Option<u64>
Get retry delay in milliseconds if applicable
Trait Implementations§
Source§impl Clone for EMSError
Manual Clone implementation for EMSError (some inner types don’t implement Clone)
impl Clone for EMSError
Manual Clone implementation for EMSError (some inner types don’t implement Clone)
Source§impl Error for EMSError
impl Error for EMSError
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 ErrorClassification for EMSError
impl ErrorClassification for EMSError
Source§fn is_per_order_error(&self) -> bool
fn is_per_order_error(&self) -> bool
Source§fn is_transport_error(&self) -> bool
fn is_transport_error(&self) -> bool
Source§impl From<AuthenticationError> for EMSError
impl From<AuthenticationError> for EMSError
Source§fn from(err: AuthenticationError) -> Self
fn from(err: AuthenticationError) -> Self
Source§impl From<BithumbError> for EMSError
impl From<BithumbError> for EMSError
Source§fn from(err: BithumbError) -> Self
fn from(err: BithumbError) -> Self
Source§impl From<CommonError> for EMSError
Conversion from CommonError
impl From<CommonError> for EMSError
Conversion from CommonError
Source§fn from(err: CommonError) -> Self
fn from(err: CommonError) -> Self
Auto Trait Implementations§
impl Freeze for EMSError
impl !RefUnwindSafe for EMSError
impl Send for EMSError
impl Sync for EMSError
impl Unpin for EMSError
impl !UnwindSafe for EMSError
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.