Fix problme when no exchange is given to download-data

This commit is contained in:
Matthias
2019-09-21 11:24:51 +02:00
parent 74a0f44230
commit 3245ebccd4
3 changed files with 32 additions and 1 deletions

View File

@@ -27,6 +27,14 @@ def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
logger.info("Checking exchange...")
exchange = config.get('exchange', {}).get('name').lower()
if not exchange:
raise OperationalException(
f'This command requires a configured exchange. You can use either '
f'`--exchange <exchange_name` or use a configuration via `--config`.\n'
f'The following exchanges are supported by ccxt: '
f'{", ".join(available_exchanges())}'
)
if not is_exchange_available(exchange):
raise OperationalException(
f'Exchange "{exchange}" is not supported by ccxt '