Skip to content

Commit 2aea0aa

Browse files
committed
Add error traceback to the InvalidActivity exception
1 parent aad77a1 commit 2aea0aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

chaoslib/provider/python.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from distutils.log import error
12
import importlib
23
import inspect
34
import sys
@@ -88,10 +89,11 @@ def validate_python_activity(activity: Activity): # noqa: C901
8889

8990
try:
9091
mod = importlib.import_module(mod_name)
91-
except ImportError:
92+
except ImportError as e:
9293
raise InvalidActivity(
9394
"could not find Python module '{mod}' "
94-
"in activity '{name}'".format(mod=mod_name, name=activity_name)
95+
"in activity '{name}'"
96+
"\nthe error is:\n{error}".format(mod=mod_name, name=activity_name, error=e)
9597
)
9698

9799
found_func = False

0 commit comments

Comments
 (0)