More configError usages
This commit is contained in:
@@ -6,7 +6,7 @@ import logging
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from freqtrade.constants import Config
|
from freqtrade.constants import Config
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import ConfigurationError, OperationalException
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -41,7 +41,7 @@ def process_removed_setting(config: Config,
|
|||||||
section1_config = config.get(section1, {})
|
section1_config = config.get(section1, {})
|
||||||
if name1 in section1_config:
|
if name1 in section1_config:
|
||||||
section_2 = f"{section2}.{name2}" if section2 else f"{name2}"
|
section_2 = f"{section2}.{name2}" if section2 else f"{name2}"
|
||||||
raise OperationalException(
|
raise ConfigurationError(
|
||||||
f"Setting `{section1}.{name1}` has been moved to `{section_2}. "
|
f"Setting `{section1}.{name1}` has been moved to `{section_2}. "
|
||||||
f"Please delete it from your configuration and use the `{section_2}` "
|
f"Please delete it from your configuration and use the `{section_2}` "
|
||||||
"setting instead."
|
"setting instead."
|
||||||
@@ -122,7 +122,7 @@ def process_temporary_deprecated_settings(config: Config) -> None:
|
|||||||
None, 'ignore_roi_if_entry_signal')
|
None, 'ignore_roi_if_entry_signal')
|
||||||
if (config.get('edge', {}).get('enabled', False)
|
if (config.get('edge', {}).get('enabled', False)
|
||||||
and 'capital_available_percentage' in config.get('edge', {})):
|
and 'capital_available_percentage' in config.get('edge', {})):
|
||||||
raise OperationalException(
|
raise ConfigurationError(
|
||||||
"DEPRECATED: "
|
"DEPRECATED: "
|
||||||
"Using 'edge.capital_available_percentage' has been deprecated in favor of "
|
"Using 'edge.capital_available_percentage' has been deprecated in favor of "
|
||||||
"'tradable_balance_ratio'. Please migrate your configuration to "
|
"'tradable_balance_ratio'. Please migrate your configuration to "
|
||||||
@@ -131,7 +131,7 @@ def process_temporary_deprecated_settings(config: Config) -> None:
|
|||||||
)
|
)
|
||||||
if 'ticker_interval' in config:
|
if 'ticker_interval' in config:
|
||||||
|
|
||||||
raise OperationalException(
|
raise ConfigurationError(
|
||||||
"DEPRECATED: 'ticker_interval' detected. "
|
"DEPRECATED: 'ticker_interval' detected. "
|
||||||
"Please use 'timeframe' instead of 'ticker_interval."
|
"Please use 'timeframe' instead of 'ticker_interval."
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional
|
|||||||
import rapidjson
|
import rapidjson
|
||||||
|
|
||||||
from freqtrade.constants import MINIMAL_CONFIG, Config
|
from freqtrade.constants import MINIMAL_CONFIG, Config
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import ConfigurationError, OperationalException
|
||||||
from freqtrade.misc import deep_merge_dicts
|
from freqtrade.misc import deep_merge_dicts
|
||||||
|
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ def load_config_file(path: str) -> Dict[str, Any]:
|
|||||||
' Please create a config file or check whether it exists.') from None
|
' Please create a config file or check whether it exists.') from None
|
||||||
except rapidjson.JSONDecodeError as e:
|
except rapidjson.JSONDecodeError as e:
|
||||||
err_range = log_config_error_range(path, str(e))
|
err_range = log_config_error_range(path, str(e))
|
||||||
raise OperationalException(
|
raise ConfigurationError(
|
||||||
f'{e}\n'
|
f'{e}\n'
|
||||||
f'Please verify the following segment of your configuration:\n{err_range}'
|
f'Please verify the following segment of your configuration:\n{err_range}'
|
||||||
if err_range else 'Please verify your configuration file for syntax errors.'
|
if err_range else 'Please verify your configuration file for syntax errors.'
|
||||||
@@ -83,7 +83,7 @@ def load_from_files(
|
|||||||
"""
|
"""
|
||||||
config: Config = {}
|
config: Config = {}
|
||||||
if level > 5:
|
if level > 5:
|
||||||
raise OperationalException("Config loop detected.")
|
raise ConfigurationError("Config loop detected.")
|
||||||
|
|
||||||
if not files:
|
if not files:
|
||||||
return deepcopy(MINIMAL_CONFIG)
|
return deepcopy(MINIMAL_CONFIG)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from typing import Optional
|
|||||||
from typing_extensions import Self
|
from typing_extensions import Self
|
||||||
|
|
||||||
from freqtrade.constants import DATETIME_PRINT_FORMAT
|
from freqtrade.constants import DATETIME_PRINT_FORMAT
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import ConfigurationError
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -156,7 +156,7 @@ class TimeRange:
|
|||||||
else:
|
else:
|
||||||
stop = int(stops)
|
stop = int(stops)
|
||||||
if start > stop > 0:
|
if start > stop > 0:
|
||||||
raise OperationalException(
|
raise ConfigurationError(
|
||||||
f'Start date is after stop date for timerange "{text}"')
|
f'Start date is after stop date for timerange "{text}"')
|
||||||
return cls(stype[0], stype[1], start, stop)
|
return cls(stype[0], stype[1], start, stop)
|
||||||
raise OperationalException(f'Incorrect syntax for timerange "{text}"')
|
raise ConfigurationError(f'Incorrect syntax for timerange "{text}"')
|
||||||
|
|||||||
Reference in New Issue
Block a user