Enum EMSError

Source
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: SmartString

Error message describing the rate limit violation

§retry_after_ms: Option<u64>

Optional retry delay in milliseconds

§

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: SmartString

Name of the exchange that generated the error

§code: i32

Exchange-specific error code

§message: SmartString

Error message from the exchange

§details: Option<SmartString>

Optional additional error details

§

OperationNotSupported

Operation not supported by exchange

Fields

§exchange: SmartString

Name of the exchange that doesn’t support the operation

§operation: SmartString

Description of the unsupported operation

§

UnknownError(SmartString)

Unknown errors

§

JsonError(Error)

Error with JSON serialization/deserialization

§

JsonParsingError

JSON parsing error with context

Fields

§context: SmartString

Context where the JSON parsing error occurred

§message: SmartString

Detailed error message

§

IoError(Error)

General I/O errors

§

NetworkError(SmartString)

Network/HTTP errors

§

Timeout

Timeout errors

Fields

§duration_ms: u64

Duration in milliseconds after which the timeout occurred

§context: SmartString

Context 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

Source

pub fn connection<S: Into<SmartString>>(msg: S) -> Self

Create a connection error with a descriptive message

Source

pub fn auth<S: Into<SmartString>>(msg: S) -> Self

Create an authentication error with a descriptive message

Source

pub fn order_submission<S: Into<SmartString>>(msg: S) -> Self

Create an order submission error with a descriptive message

Source

pub fn order_cancellation<S: Into<SmartString>>(msg: S) -> Self

Create an order cancellation error with a descriptive message

Source

pub fn order_modification<S: Into<SmartString>>(msg: S) -> Self

Create an order modification error with a descriptive message

Source

pub fn rate_limit<S: Into<SmartString>>( msg: S, retry_after_ms: Option<u64>, ) -> Self

Create a rate limit error

Source

pub fn invalid_params<S: Into<SmartString>>(msg: S) -> Self

Create an invalid order parameters error

Source

pub fn insufficient_balance<S: Into<SmartString>>(msg: S) -> Self

Create an insufficient balance error

Source

pub fn instrument_not_found<S: Into<SmartString>>(symbol: S) -> Self

Create an instrument not found error

Source

pub fn exchange_api<S1, S2, S3>( exchange: S1, code: i32, message: S2, details: Option<S3>, ) -> Self
where S1: Into<SmartString>, S2: Into<SmartString>, S3: Into<SmartString>,

Create an exchange API error

Source

pub fn not_supported<S1, S2>(exchange: S1, operation: S2) -> Self
where S1: Into<SmartString>, S2: Into<SmartString>,

Create an operation not supported error

Source

pub fn websocket<S: Into<SmartString>>(msg: S) -> Self

Create a WebSocket error

Source

pub fn timeout<S: Into<SmartString>>(duration_ms: u64, context: S) -> Self

Create a timeout error

Source

pub fn json_parse<S1, S2>(context: S1, message: S2) -> Self
where S1: Into<SmartString>, S2: Into<SmartString>,

Create a JSON parsing error with context

Source

pub fn internal<S: Into<SmartString>>(msg: S) -> Self

Create an internal error

Source

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

Source

pub fn json_error(err: &impl Display) -> Self

Create a JSON error with optimized formatting

Source

pub fn connection_failed(err: &impl Display) -> Self

Create a connection failed error with optimized formatting

Source

pub fn http_status_error(status: u16) -> SmartString

Create an HTTP status error with optimized formatting

Source

pub fn rate_limit_with_exchange(exchange: &str, msg: &str) -> SmartString

Create a rate limit error with optimized formatting

Source

pub fn auth_failed_error(exchange: &str) -> Self

Create an authentication failed error with optimized formatting

Source

pub fn access_forbidden_error(exchange: &str) -> Self

Create an access forbidden error with optimized formatting

Source

pub fn rate_limit_exceeded_error(exchange: &str) -> SmartString

Create a rate limit exceeded error with optimized formatting

Source

pub fn internal_server_error(exchange: &str) -> Self

Create an internal server error with optimized formatting

Source

pub fn service_unavailable_error(exchange: &str) -> Self

Create a service unavailable error with optimized formatting

Source

pub fn gateway_timeout_error(exchange: &str) -> SmartString

Create a gateway timeout error with optimized formatting

Source

pub fn auth_exchange_failed(exchange: &str, err: &impl Display) -> Self

Create an auth error with optimized formatting for exchange auth failures

Source

pub fn auth_invalid_header_name(err: &impl Display) -> Self

Create an auth error with optimized formatting for header name errors

Source

pub fn auth_invalid_header_value(err: &impl Display) -> Self

Create an auth error with optimized formatting for header value errors

Source

pub const fn is_recoverable(&self) -> bool

Check if error is recoverable (e.g., temporary network issues)

Source

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)

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EMSError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EMSError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for EMSError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl ErrorClassification for EMSError

Source§

fn is_per_order_error(&self) -> bool

Check if this error is a per-order validation error (not transport-level)
Source§

fn is_transport_error(&self) -> bool

Check if this error is a transport-level error affecting the entire batch
Source§

impl From<AuthenticationError> for EMSError

Source§

fn from(err: AuthenticationError) -> Self

Converts to this type from the input type.
Source§

impl From<BithumbError> for EMSError

Source§

fn from(err: BithumbError) -> Self

Converts to this type from the input type.
Source§

impl From<CommonError> for EMSError

Conversion from CommonError

Source§

fn from(err: CommonError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for EMSError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for EMSError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for EMSError

Conversion from anyhow::Error

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for EMSError

Conversion from reqwest::Error

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl<T> From<SendError<T>> for EMSError

Conversion from flume::SendError

Source§

fn from(err: SendError<T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,