Skip to content

Commit b640f14

Browse files
authored
Add a more descriptive error when a kind cannot be found (taskcluster#721)
1 parent 4cae05e commit b640f14

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/taskgraph/generator.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,14 @@ def _run(self):
306306
all_tasks = {}
307307
for kind_name in kind_graph.visit_postorder():
308308
logger.debug(f"Loading tasks for kind {kind_name}")
309-
kind = kinds[kind_name]
309+
310+
kind = kinds.get(kind_name)
311+
if not kind:
312+
message = f'Could not find the kind "{kind_name}"\nAvailable kinds:\n'
313+
for k in sorted(kinds):
314+
message += f' - "{k}"\n'
315+
raise Exception(message)
316+
310317
try:
311318
new_tasks = kind.load_tasks(
312319
parameters,

0 commit comments

Comments
 (0)