fix: use ConfigurationError instead of OperationalException

This commit is contained in:
Matthias
2025-12-28 13:24:43 +01:00
parent b8cf38cb6f
commit 6e9b60c0b0
+4 -4
View File
@@ -8,7 +8,7 @@ from typing import Any
from freqtrade.constants import BuySell from freqtrade.constants import BuySell
from freqtrade.enums import MarginMode, TradingMode from freqtrade.enums import MarginMode, TradingMode
from freqtrade.enums.runmode import NON_UTIL_MODES from freqtrade.enums.runmode import NON_UTIL_MODES
from freqtrade.exceptions import ExchangeError, OperationalException from freqtrade.exceptions import ConfigurationError, ExchangeError, OperationalException
from freqtrade.exchange import Exchange from freqtrade.exchange import Exchange
from freqtrade.exchange.exchange_types import CcxtBalances, CcxtOrder, CcxtPosition, FtHas from freqtrade.exchange.exchange_types import CcxtBalances, CcxtOrder, CcxtPosition, FtHas
from freqtrade.util.datetime_helpers import dt_from_ts from freqtrade.util.datetime_helpers import dt_from_ts
@@ -70,13 +70,13 @@ class Hyperliquid(Exchange):
return return
if self.trading_mode != TradingMode.FUTURES: if self.trading_mode != TradingMode.FUTURES:
if configured: if configured:
raise OperationalException( raise ConfigurationError(
"HIP-3 DEXes are only supported in FUTURES trading mode. " "HIP-3 DEXes are only supported in FUTURES trading mode. "
"Please update your configuration!" "Please update your configuration!"
) )
return return
if configured and self.margin_mode != MarginMode.ISOLATED: if configured and self.margin_mode != MarginMode.ISOLATED:
raise OperationalException( raise ConfigurationError(
"HIP-3 DEXes require 'isolated' margin mode. " "HIP-3 DEXes require 'isolated' margin mode. "
f"Current margin mode: '{self.margin_mode.value}'. " f"Current margin mode: '{self.margin_mode.value}'. "
"Please update your configuration!" "Please update your configuration!"
@@ -91,7 +91,7 @@ class Hyperliquid(Exchange):
invalid = set(configured) - available invalid = set(configured) - available
if invalid: if invalid:
raise OperationalException( raise ConfigurationError(
f"Invalid HIP-3 DEXes configured: {sorted(invalid)}. " f"Invalid HIP-3 DEXes configured: {sorted(invalid)}. "
f"Available DEXes: {sorted(available)}. " f"Available DEXes: {sorted(available)}. "
f"Check your 'hip3_dexes' configuration!" f"Check your 'hip3_dexes' configuration!"