handle requests exception in validate_pairs

This commit is contained in:
gcarq 2017-11-18 22:22:45 +01:00
parent d41837817c
commit b16ccb9919
1 changed files with 7 additions and 1 deletions

View File

@ -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):