1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00
thatmattlove-hyperglass/hyperglass/cli/exceptions.py
2020-02-14 16:28:45 -07:00

15 lines
432 B
Python

"""hyperglass CLI custom exceptions."""
# Third Party
from click import ClickException, echo
from click._compat import get_text_stderr
class CliError(ClickException):
"""Custom exception to exclude the 'Error:' prefix from echos."""
def show(self, file=None):
"""Exclude 'Error:' prefix from raised exceptions."""
if file is None:
file = get_text_stderr()
echo(self.format_message())