mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
fix(conf): add cause to re-raised value-error to keep context. (#9940)
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Xingyao Wang <xingyaoww@gmail.com>
This commit is contained in:
@@ -224,9 +224,9 @@ def load_from_toml(cfg: OpenHandsConfig, toml_file: str = 'config.toml') -> None
|
|||||||
logger.openhands_logger.warning(
|
logger.openhands_logger.warning(
|
||||||
f'Cannot parse [sandbox] config from toml, values have not been applied.\nError: {e}'
|
f'Cannot parse [sandbox] config from toml, values have not been applied.\nError: {e}'
|
||||||
)
|
)
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
# Re-raise ValueError from SandboxConfig.from_toml_section
|
# Re-raise ValueError from SandboxConfig.from_toml_section
|
||||||
raise ValueError('Error in [sandbox] section in config.toml')
|
raise ValueError('Error in [sandbox] section in config.toml') from e
|
||||||
|
|
||||||
# Process MCP sections if present
|
# Process MCP sections if present
|
||||||
if 'mcp' in toml_config:
|
if 'mcp' in toml_config:
|
||||||
|
|||||||
Reference in New Issue
Block a user