Skip to content

Commit

Permalink
cover with try catch exception for al methods
Browse files Browse the repository at this point in the history
  • Loading branch information
prasad-sawantdesai committed Jan 17, 2025
1 parent e53f45d commit f43354f
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions imas/backends/imas_core/imas_interface.py
Original file line number Diff line number Diff line change
@@ -105,8 +105,8 @@ def __init__(self, lowlevel):
setattr(self, method, ll_method)

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

def _minimal_version(self, minversion):
5 changes: 4 additions & 1 deletion imas/command/cli.py
Original file line number Diff line number Diff line change
@@ -76,7 +76,10 @@ def print_version():
dd_versions = ", ".join(imas.dd_zip.dd_xml_versions())
grid.add_row("Available data dictionary versions:", dd_versions)
grid.add_section()
grid.add_row("Access Layer core version:", ll_interface.get_al_version() or "N/A")
try:
grid.add_row("Access Layer core version:", ll_interface.get_al_version() or "N/A")
except Exception as exc:
grid.add_row("Access Layer core version:", "N/A")
console.Console().print(grid)


0 comments on commit f43354f

Please sign in to comment.