summaryrefslogtreecommitdiff
path: root/cmd2/exceptions.py
diff options
context:
space:
mode:
authorxNinjaKittyx <xNinjaKittyx@users.noreply.github.com>2020-12-15 17:21:33 -0800
committerxNinjaKittyx <xNinjaKittyx@users.noreply.github.com>2020-12-15 18:20:13 -0800
commit9aa54a5b27468d61337528cb1e1b5b9b11a80978 (patch)
tree567693115cc101efb9254a96d96d80e9f9ccd557 /cmd2/exceptions.py
parent03c65c60b39e369958b056c5c844d36d515c8a63 (diff)
downloadcmd2-git-ci_improvements.tar.gz
Adds pre-commit config to run various lintersci_improvements
This ads black, isort, pyupgrade, and flake8 to pre-commit-config.yaml There are also some small changes to travis.yml and tasks.py to reduce some repeated configurations that should be consolidated into setup.cfg. Most other changes are automated by the linter scripts.
Diffstat (limited to 'cmd2/exceptions.py')
-rw-r--r--cmd2/exceptions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd2/exceptions.py b/cmd2/exceptions.py
index d253985a..c5a08202 100644
--- a/cmd2/exceptions.py
+++ b/cmd2/exceptions.py
@@ -6,11 +6,13 @@
# The following exceptions are part of the public API
############################################################################################################
+
class SkipPostcommandHooks(Exception):
"""
Custom exception class for when a command has a failure bad enough to skip post command
hooks, but not bad enough to print the exception to the user.
"""
+
pass
@@ -21,6 +23,7 @@ class Cmd2ArgparseError(SkipPostcommandHooks):
loop, catch the SystemExit and raise this instead. If you still need to run post command hooks
after parsing fails, just return instead of raising an exception.
"""
+
pass
@@ -29,8 +32,10 @@ class CommandSetRegistrationError(Exception):
Exception that can be thrown when an error occurs while a CommandSet is being added or removed
from a cmd2 application.
"""
+
pass
+
############################################################################################################
# The following exceptions are NOT part of the public API and are intended for internal use only.
############################################################################################################
@@ -38,19 +43,23 @@ class CommandSetRegistrationError(Exception):
class Cmd2ShlexError(Exception):
"""Raised when shlex fails to parse a command line string in StatementParser"""
+
pass
class EmbeddedConsoleExit(SystemExit):
"""Custom exception class for use with the py command."""
+
pass
class EmptyStatement(Exception):
"""Custom exception class for handling behavior when the user just presses <Enter>."""
+
pass
class RedirectionError(Exception):
"""Custom exception class for when redirecting or piping output fails"""
+
pass