Fix problme when no exchange is given to download-data
This commit is contained in:
@@ -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 '
|
||||
|
Reference in New Issue
Block a user