mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
Adding error logging when config file is not found. (#11419)
Co-authored-by: jarrycyx <dzdzzd@126.com> Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
This commit is contained in:
@@ -148,7 +148,10 @@ def load_from_toml(cfg: OpenHandsConfig, toml_file: str = 'config.toml') -> None
|
||||
try:
|
||||
with open(toml_file, 'r', encoding='utf-8') as toml_contents:
|
||||
toml_config = toml.load(toml_contents)
|
||||
except FileNotFoundError:
|
||||
except FileNotFoundError as e:
|
||||
logger.openhands_logger.error(
|
||||
f'{toml_file} not found: {e}. Toml values have not been applied.'
|
||||
)
|
||||
return
|
||||
except toml.TomlDecodeError as e:
|
||||
logger.openhands_logger.warning(
|
||||
@@ -601,7 +604,10 @@ def get_llms_for_routing_config(toml_file: str = 'config.toml') -> dict[str, LLM
|
||||
try:
|
||||
with open(toml_file, 'r', encoding='utf-8') as toml_contents:
|
||||
toml_config = toml.load(toml_contents)
|
||||
except FileNotFoundError:
|
||||
except FileNotFoundError as e:
|
||||
logger.openhands_logger.error(
|
||||
f'Config file not found: {e}. Toml values have not been applied.'
|
||||
)
|
||||
return llms_for_routing
|
||||
except toml.TomlDecodeError as e:
|
||||
logger.openhands_logger.error(
|
||||
|
||||
Reference in New Issue
Block a user