mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-01 02:54:25 +02:00
Use general exception for usage error
This commit is contained in:
@@ -46,7 +46,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
|
|||||||
try:
|
try:
|
||||||
return self._handle_obsolate_command(name)
|
return self._handle_obsolate_command(name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise exception.UnknownCLICommand(name)
|
raise click.UsageError('No such command "%s"' % name, ctx)
|
||||||
return mod.cli
|
return mod.cli
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@@ -48,12 +48,6 @@ class PlatformNotInstalledYet(PlatformioException):
|
|||||||
"Use `platformio platforms install` command"
|
"Use `platformio platforms install` command"
|
||||||
|
|
||||||
|
|
||||||
class UnknownCLICommand(PlatformioException):
|
|
||||||
|
|
||||||
MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\
|
|
||||||
" to see all available commands"
|
|
||||||
|
|
||||||
|
|
||||||
class UnknownBoard(PlatformioException):
|
class UnknownBoard(PlatformioException):
|
||||||
|
|
||||||
MESSAGE = "Unknown board type '%s'"
|
MESSAGE = "Unknown board type '%s'"
|
||||||
|
Reference in New Issue
Block a user