From 29fe91182816240774135db31d377d25309297f5 Mon Sep 17 00:00:00 2001 From: Carlos Freund Date: Thu, 31 Jul 2025 15:59:13 +0100 Subject: [PATCH] fix(conf): add cause to re-raised value-error to keep context. (#9940) Co-authored-by: openhands Co-authored-by: Xingyao Wang --- openhands/core/config/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhands/core/config/utils.py b/openhands/core/config/utils.py index 9870204ae7..7f5c9b8b46 100644 --- a/openhands/core/config/utils.py +++ b/openhands/core/config/utils.py @@ -224,9 +224,9 @@ def load_from_toml(cfg: OpenHandsConfig, toml_file: str = 'config.toml') -> None logger.openhands_logger.warning( 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 - 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 if 'mcp' in toml_config: