From 5321200c05b3b693581ec4238c74eb02e0b715d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 8 May 2018 21:00:27 +0200 Subject: Check before processing that credentials are valid --- market.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'market.py') diff --git a/market.py b/market.py index caa9513..9550b77 100644 --- a/market.py +++ b/market.py @@ -1,4 +1,4 @@ -from ccxt import ExchangeError, NotSupported, RequestTimeout, InvalidNonce +from ccxt import AuthenticationError, ExchangeError, NotSupported, RequestTimeout, InvalidNonce import ccxt_wrapper as ccxt import time import dbs @@ -88,6 +88,7 @@ class Market: def process(self, actions, before=False, after=False): try: + self.ccxt.check_required_credentials() for action in actions: if bool(before) is bool(after): self.processor.process(action, steps="all") @@ -95,6 +96,8 @@ class Market: self.processor.process(action, steps="before") elif after: self.processor.process(action, steps="after") + except AuthenticationError: + self.report.log_error("market_authentication", message="Impossible to authenticate to market") except Exception as e: import traceback self.report.log_error("market_process", exception=e, message=traceback.format_exc()) -- cgit v1.2.3