mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Replace "Unknown board..." message with appropriate exception
This commit is contained in:
@ -16,6 +16,8 @@ from os.path import join
|
|||||||
from SCons.Script import (DefaultEnvironment, SConscript, SConscriptChdir,
|
from SCons.Script import (DefaultEnvironment, SConscript, SConscriptChdir,
|
||||||
Variables)
|
Variables)
|
||||||
|
|
||||||
|
from platformio.exception import UnknownBoard
|
||||||
|
|
||||||
# AllowSubstExceptions()
|
# AllowSubstExceptions()
|
||||||
|
|
||||||
# allow common variables from INI file
|
# allow common variables from INI file
|
||||||
@ -71,8 +73,8 @@ env = DefaultEnvironment()
|
|||||||
if "BOARD" in env:
|
if "BOARD" in env:
|
||||||
try:
|
try:
|
||||||
env.Replace(BOARD_OPTIONS=util.get_boards(env.subst("$BOARD")))
|
env.Replace(BOARD_OPTIONS=util.get_boards(env.subst("$BOARD")))
|
||||||
except KeyError:
|
except UnknownBoard as e:
|
||||||
env.Exit("Error: Unknown board '%s'" % env.subst("$BOARD"))
|
env.Exit("Error: %s" % str(e))
|
||||||
|
|
||||||
if "BOARD_MCU" not in env:
|
if "BOARD_MCU" not in env:
|
||||||
env.Replace(BOARD_MCU="${BOARD_OPTIONS['build']['mcu']}")
|
env.Replace(BOARD_MCU="${BOARD_OPTIONS['build']['mcu']}")
|
||||||
|
Reference in New Issue
Block a user