Skip to content

Commit 59d11c2

Browse files
committed
[ModelicaSystemCmd] fix exception handling
* define specific exceptions
1 parent f02d506 commit 59d11c2

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
@@ -259,7 +259,7 @@ def run(self) -> int:
259259
raise ModelicaSystemError(f"Error running command {repr(cmdl)}: {stderr}")
260260
except subprocess.TimeoutExpired:
261261
raise ModelicaSystemError(f"Timeout running command {repr(cmdl)}")
262-
except Exception as ex:
262+
except subprocess.CalledProcessError as ex:
263263
raise ModelicaSystemError(f"Error running command {repr(cmdl)}") from ex
264264

265265
return returncode

0 commit comments

Comments
 (0)