Skip to content

Commit

Permalink
style(CCXT): added error log message on failed orders
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-mackle committed Mar 23, 2024
1 parent 2eab028 commit 9ac7cfb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autotrader/brokers/ccxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def place_order(self, order: Order, **kwargs) -> None:
params=order.ccxt_params,
)
except Exception as e:
self._logger.error(f"Error placing {order}: {e}")
placed_order = e

return placed_order
Expand Down Expand Up @@ -180,6 +181,7 @@ def cancel_order(self, order_id: int, **kwargs) -> None:
cancelled_order = self.api.cancel_order(id=order_id, **kwargs)

except Exception as e:
self._logger.error(f"Error cancelling order {order_id}: {e}")
cancelled_order = e

return cancelled_order
Expand Down Expand Up @@ -670,6 +672,7 @@ def _modify_order(self, order: Order):
params=order.ccxt_params,
)
except Exception as e:
self._logger.error(f"Error modifying {order}: {e}")
modified_order = e
return modified_order

Expand Down

0 comments on commit 9ac7cfb

Please sign in to comment.