Skip to content

Commit

Permalink
#2599 make error more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Jan 13, 2023
1 parent 4e36436 commit 8403c31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pybamm/solvers/idaklu_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import importlib

idaklu_spec = importlib.util.find_spec("pybamm.solvers.idaklu")
idaklu_err = None
if idaklu_spec is not None:
try:
idaklu = importlib.util.module_from_spec(idaklu_spec)
idaklu_spec.loader.exec_module(idaklu)
except ImportError as e: # pragma: no cover
print('ERROR IS', e)
idaklu_err = str(e)
idaklu_spec = None


Expand Down Expand Up @@ -111,7 +113,7 @@ def __init__(
self._options = options

if idaklu_spec is None: # pragma: no cover
raise ImportError("KLU is not installed")
raise ImportError("KLU is not installed", idaklu_err)

super().__init__(
"ida",
Expand Down

0 comments on commit 8403c31

Please sign in to comment.