From 6ff99e4dddda4c3e2004708fa4f4651faed2cf5c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 26 Aug 2016 01:29:26 +0300 Subject: [PATCH] Show error when boards manifest doesn't contain required fields --- platformio/exception.py | 2 +- platformio/managers/platform.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/platformio/exception.py b/platformio/exception.py index 5b30ba24..6d3a7641 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -45,7 +45,7 @@ class UnknownPlatform(PlatformioException): class PlatformNotInstalledYet(PlatformioException): MESSAGE = "The platform '{0}' has not been installed yet. "\ - "Use `platformio platforms install {0}` command" + "Use `platformio platform install {0}` command" class BoardNotDefined(PlatformioException): diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index ce37665c..fb53d255 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -496,7 +496,10 @@ class PlatformBoardConfig(object): self._manifest = util.load_json(manifest_path) except ValueError: raise exception.InvalidBoardManifest(manifest_path) - assert set(["name", "url", "vendor"]) <= set(self._manifest.keys()) + if not set(["name", "url", "vendor"]) <= set(self._manifest.keys()): + raise exception.PlatformioException( + "Please specify name, url and vendor fields for " + + manifest_path) def get(self, path, default=None): try: