Skip to content

Commit b93f121

Browse files
committed
[ModelicaSystem._run_cmd()] differentiate between OM error and nonzero return code
1 parent 78e7ae2 commit b93f121

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

OMPython/ModelicaSystem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ def _run_cmd(self, cmd: list, timeout: Optional[int] = None):
314314
timeout=timeout)
315315
stdout = cmdres.stdout.strip()
316316
stderr = cmdres.stderr.strip()
317-
if cmdres.returncode != 0 or stderr:
317+
if cmdres.returncode != 0:
318+
raise ModelicaSystemError(f"Error running command {cmd}: nonzero return code")
319+
if stderr:
318320
raise ModelicaSystemError(f"Error running command {cmd}: {stderr}")
319321
if self._verbose and stdout:
320322
logger.info("OM output for command %s:\n%s", cmd, stdout)

0 commit comments

Comments
 (0)