# DefaultErrorHandlers

Default error handlers attached to all algorithmic orders if no explicit handlers are supplied.

Source:
  - default_handlers/index.js, line 3

### Methods

#### (async, static) onErrorInsufficientBalance(instance, order, notification) → {Promise}

Source:
  - default_handlers/error_insufficient_balance.js, line 21

Called when an insufficient balance notification is received. Emits an `'exec:stop'` event and cancels all open orders after the teardown grace period.

Mapped to the `error:insufficient_balance` event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`instance` | object | AO instance
`order` | object | order which is below the min size for its symbol
`notification` | object | incoming error notification

##### Listens to Events:

- AOHost~event:errorsInsufficientBalance

##### Returns:

p - resolves on completion

Type
  Promise

#### (async, static) onErrorMinimumSize(instance, order, notification) → {Promise}

Source:
  - default_handlers/error_minimum_size.js, line 21

Called when a minimum order size error is received. Emits an `'exec:stop'` event and cancels all orders after the teardown grace period.

Mapped to the `error:minimum_size` event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`instance` | object | AO instance
`order` | object | order which is below the min size for its symbol

`notification`

object

barebones notification object from BFX

###### Properties

Name | Type | Description
--- | --- | ---
`text` | string | original notification text

##### Listens to Events:

- AOHost~event:errorsMinimumSize

##### Returns:

p - resolves on completion

Type
  Promise

#### (async, static) onOrdersOrderError(instance) → {Promise}

Source:
  - default_handlers/orders_order_error.js, line 18

Called when a generic order error event is received. Emits an `'exec:stop'` event and cancels open orders after the teardown grace period.

Mapped to the `orders:order_error` event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`instance` | object | AO instance

##### Listens to Events:

- AOHost~event:ordersOrderError

##### Returns:

p - resolves on completion

Type
  Promise