Build - raise exception if toolchain is not recognized

This sends the message that toolchain specified is not valid.
Martin Kojtal 2016-04-20 13:16:37 +01:00
parent 227ffecb83
commit 3e91490259
1 changed files with 5 additions and 1 deletions

View File

@ -83,7 +83,11 @@ def build_project(src_path, build_path, target, toolchain_name,
""" This function builds project. Project can be for example one test / UT
"""
# Toolchain instance
toolchain = TOOLCHAIN_CLASSES[toolchain_name](target, options, notify, macros, silent, extra_verbose=extra_verbose)
try:
toolchain = TOOLCHAIN_CLASSES[toolchain_name](target, options, notify, macros, silent, extra_verbose=extra_verbose)
except KeyError as e:
raise KeyError("Toolchain %s not supported" % toolchain_name)
toolchain.VERBOSE = verbose
toolchain.jobs = jobs
toolchain.build_all = clean