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:
Carlos Freund 2025-07-31 15:59:13 +01:00 committed by GitHub
parent 5282770a4c
commit 29fe911828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: