Skip to content

Commit c04b893

Browse files
committed
Improve errors when effect packages or effects are not found
1 parent 6052c4a commit c04b893

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

demosys/project/default.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,17 @@ def create_resources(self):
2121
pass
2222

2323
def create_effect_instances(self):
24-
cls = effects.find_effect_class(self.path)
24+
if self.effect_class_name:
25+
cls = effects.find_effect_class(self.path)
26+
if not cls.runnable:
27+
raise ValueError("Effect doesn't have the runnable flag set:", self.path)
28+
else:
29+
effect_package = effects.get_package(self.effect_package_name)
30+
runnable_effects = effect_package.runnable_effects()
2531

26-
if not cls.runnable:
27-
raise ValueError("Effect doesn't have the runnable flag set:", self.path)
32+
if not runnable_effects:
33+
raise ValueError("No runnable effects found in effect package", self.effect_package_name)
34+
35+
cls = runnable_effects[-1]
2836

2937
self.effect = self.create_effect('default', cls.__name__)

0 commit comments

Comments
 (0)