mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Show error message when broken JSON manifest is found
This commit is contained in:
@ -60,6 +60,11 @@ class UnknownBoard(PlatformioException):
|
||||
MESSAGE = "Unknown board ID '{0}'"
|
||||
|
||||
|
||||
class InvalidBoardManifest(PlatformioException):
|
||||
|
||||
MESSAGE = "Invalid board JSON manifest '{0}'"
|
||||
|
||||
|
||||
class UnknownFramework(PlatformioException):
|
||||
|
||||
MESSAGE = "Unknown framework '{0}'"
|
||||
|
@ -491,7 +491,10 @@ class PlatformBoardConfig(object):
|
||||
self._id = basename(manifest_path)[:-5]
|
||||
assert isfile(manifest_path)
|
||||
self.manifest_path = manifest_path
|
||||
self._manifest = util.load_json(manifest_path)
|
||||
try:
|
||||
self._manifest = util.load_json(manifest_path)
|
||||
except ValueError:
|
||||
raise exception.InvalidBoardManifest(manifest_path)
|
||||
assert set(["name", "url", "vendor"]) <= set(self._manifest.keys())
|
||||
|
||||
def get(self, path, default=None):
|
||||
|
Reference in New Issue
Block a user