Skip to content

Commit 8a7ed93

Browse files
committed
[ModelicaSystem.sendExpression] include (original) error message
'from ex' links the original exception but this is not always shown see also #328
1 parent 6b44870 commit 8a7ed93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OMPython/ModelicaSystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def sendExpression(self, expr: str, parsed: bool = True) -> Any:
570570
try:
571571
retval = self._session.sendExpression(expr, parsed)
572572
except OMCSessionException as ex:
573-
raise ModelicaSystemError(f"Error executing {repr(expr)}") from ex
573+
raise ModelicaSystemError(f"Error executing {repr(expr)}: {ex}") from ex
574574

575575
logger.debug(f"Result of executing {repr(expr)}: {textwrap.shorten(repr(retval), width=100)}")
576576

0 commit comments

Comments
 (0)