Introduce InsufficientFundsError exception

This commit is contained in:
Matthias
2020-08-14 09:57:13 +02:00
parent a6fc922f28
commit 22af82631a
4 changed files with 8 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ from typing import Dict
import ccxt
from freqtrade.exceptions import (DDosProtection, ExchangeError,
from freqtrade.exceptions import (DDosProtection, InsufficientFundsError,
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 ExchangeError(
raise InsufficientFundsError(
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