Common Errors

This section describes the common errors(assertions) on placing/submitting new orders and cancelling exiting orders.

Place Order Errors: Below are the common errors occurs during the verification of order submission.

Example of error thrown from transact:

 {
   json: {
      code: 500,
      message: 'Internal Service Error',
      error: {
        code: 3050003,
        name: 'eosio_assert_message_exception',
        what: 'eosio_assert_message assertion failure',
        details: [
          {
            message: 'assertion failure with message: Invalid order type',
            file: 'wasm_interface.cpp',
            line_number: 1075,
            method: 'eosio_assert'
          },
          {
            message: 'pending console output: ',
            file: 'apply_context.cpp',
            line_number: 113,
            method: 'exec_one'
          }
        ]
      }
    }
}

The above errors asserts whether the order type in place order is valid or not. Since order type is not valid, it will throw an error "Invalid order type"

Errors list:

"Contract is paused": Currently the contract is paused and users can't submit orders.

"Market not found": The market is not existed for the submitted order.

"Placing orders is disabled for this market": Order submission is disabled for this market.

"Invalid order type": Order type is Invalid, it should be one of the {Limit(1), Stoploss(2), Takeprofit(3)}.

"Invalid order side": Order side is invalid, it should be either buy(1) or sell(2)

"Invalid price": The price quoted is invalid, it is not within 0 and INT_MAX

"Minimum order size is ...": Min order size is not valid.

"Invalid order type - add trigger price": Trigger price is not added for stoploss and take profit orders.

"Invalid referrer name, self referral not allowed": Self referral is not allowed.

Cancel Order errors:

"Contract is paused": Currently the contract is paused and users can't submit orders.

"Invalid authorization": User is not authorized to cancel the order.

"Invalid order id": The order id is less than or equals to 0, so it's not valid.

"Order not found": The order id which user is intended to cancel is not found or existed

"Accounts mismatch, order cancellation not allowed": The account name provided is different from the account(order placed), so cancellation is not allowed.

"Market not found": The market id, which was referenced by order_id is not found .

Last updated