From 4cddc90f162558e1cf9a9c0b23099a6465cf5389 Mon Sep 17 00:00:00 2001 From: syntron Date: Tue, 4 Nov 2025 19:28:18 +0100 Subject: [PATCH] [ModelicaSystem.sendExpression] include (original) error message 'from ex' links the original exception but this is not always shown see also #328 --- OMPython/ModelicaSystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index 241b9ffc..7276f038 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -570,7 +570,7 @@ def sendExpression(self, expr: str, parsed: bool = True) -> Any: try: retval = self._session.sendExpression(expr, parsed) except OMCSessionException as ex: - raise ModelicaSystemError(f"Error executing {repr(expr)}") from ex + raise ModelicaSystemError(f"Error executing {repr(expr)}: {ex}") from ex logger.debug(f"Result of executing {repr(expr)}: {textwrap.shorten(repr(retval), width=100)}")