Skip to content

Commit 3e91490

Browse files
committed
Build - raise exception if toolchain is not recognized
This sends the message that toolchain specified is not valid.
1 parent 227ffec commit 3e91490

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/build_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ def build_project(src_path, build_path, target, toolchain_name,
8383
""" This function builds project. Project can be for example one test / UT
8484
"""
8585
# Toolchain instance
86-
toolchain = TOOLCHAIN_CLASSES[toolchain_name](target, options, notify, macros, silent, extra_verbose=extra_verbose)
86+
try:
87+
toolchain = TOOLCHAIN_CLASSES[toolchain_name](target, options, notify, macros, silent, extra_verbose=extra_verbose)
88+
except KeyError as e:
89+
raise KeyError("Toolchain %s not supported" % toolchain_name)
90+
8791
toolchain.VERBOSE = verbose
8892
toolchain.jobs = jobs
8993
toolchain.build_all = clean

0 commit comments

Comments
 (0)