Introduce ExchangeError

This commit is contained in:
Matthias
2020-06-28 16:01:40 +02:00
parent e74d2af857
commit bf61bc9d83
8 changed files with 34 additions and 26 deletions

View File

@@ -4,7 +4,7 @@ from typing import Dict
import ccxt
from freqtrade.exceptions import (DDosProtection, DependencyException,
from freqtrade.exceptions import (DDosProtection, ExchangeError,
InvalidOrderException, OperationalException,
TemporaryError)
from freqtrade.exchange import Exchange
@@ -80,7 +80,7 @@ class Binance(Exchange):
'stop price: %s. limit: %s', pair, stop_price, rate)
return order
except ccxt.InsufficientFunds as e:
raise DependencyException(
raise ExchangeError(
f'Insufficient funds to create {ordertype} sell order on market {pair}.'
f'Tried to sell amount {amount} at rate {rate}. '
f'Message: {e}') from e