Skip to content

Commit d56f0ba

Browse files
cover with try catch exception for imas-core methods
1 parent e53f45d commit d56f0ba

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

imas/backends/imas_core/imas_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def __init__(self, lowlevel):
105105
setattr(self, method, ll_method)
106106

107107
def _imas_not_available(self, *args, **kwargs):
108-
logger.error(
109-
"Some functions requires an imas installation, which is not available."
108+
raise RuntimeError(
109+
"This function requires an imas installation, which is not available."
110110
)
111111

112112
def _minimal_version(self, minversion):

imas/command/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ def print_version():
7676
dd_versions = ", ".join(imas.dd_zip.dd_xml_versions())
7777
grid.add_row("Available data dictionary versions:", dd_versions)
7878
grid.add_section()
79-
grid.add_row("Access Layer core version:", ll_interface.get_al_version() or "N/A")
79+
try:
80+
grid.add_row("Access Layer core version:", ll_interface.get_al_version() or "N/A")
81+
except Exception as exc:
82+
grid.add_row("Access Layer core version:", "N/A")
8083
console.Console().print(grid)
8184

8285

0 commit comments

Comments
 (0)