From b7ab82586028c025775c76ba99788df18e6e2140 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 17:43:59 +0200 Subject: [PATCH] Use general exception for usage error --- platformio/__main__.py | 2 +- platformio/exception.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/platformio/__main__.py b/platformio/__main__.py index e5e35aee..813558bb 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -46,7 +46,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904 try: return self._handle_obsolate_command(name) except AttributeError: - raise exception.UnknownCLICommand(name) + raise click.UsageError('No such command "%s"' % name, ctx) return mod.cli @staticmethod diff --git a/platformio/exception.py b/platformio/exception.py index 74491f70..175f430a 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -48,12 +48,6 @@ class PlatformNotInstalledYet(PlatformioException): "Use `platformio platforms install` command" -class UnknownCLICommand(PlatformioException): - - MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\ - " to see all available commands" - - class UnknownBoard(PlatformioException): MESSAGE = "Unknown board type '%s'"