Skip to main content

map_order_error

Function map_order_error 

Source
pub fn map_order_error(
    error: Error,
    instrument: &InstrumentNameExchange,
) -> UnindexedOrderError
Expand description

Maps an SDK error from placing or cancelling an order to UnindexedOrderError.

An unknown instrument is ApiError::InstrumentInvalid; anything else is classified by its text, as a refusal in a placement response is, so a shortfall of funds is ApiError::BalanceInsufficient. A cancel never fails for want of funds, so it shares the classifier harmlessly.