From b16ccb9919a39f400e2a7c507023129db7d77ca6 Mon Sep 17 00:00:00 2001 From: gcarq Date: Sat, 18 Nov 2017 22:22:45 +0100 Subject: [PATCH] handle requests exception in validate_pairs --- freqtrade/exchange/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 4eed0a61d..98ade43a0 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -6,6 +6,7 @@ from random import randint from typing import List, Dict, Any, Optional import arrow +import requests from cachetools import cached, TTLCache from freqtrade.exchange.bittrex import Bittrex @@ -65,7 +66,12 @@ def validate_pairs(pairs: List[str]) -> None: :param pairs: list of pairs :return: None """ - markets = _API.get_markets() + try: + markets = _API.get_markets() + except requests.exceptions.RequestException as e: + logger.warning('Unable to validate pairs (assuming they are correct). Reason: %s', e) + return + stake_cur = _CONF['stake_currency'] for pair in pairs: if not pair.startswith(stake_cur):