mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08: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:
parent
2a98cd9338
commit
9bcf80dba5
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user