From c4f06f5f96b96ec26b750b3c6ccfd4d2c563ea07 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Sun, 3 May 2020 14:59:17 -0700 Subject: [PATCH] CleanError's print() is now pretty_print() --- assets/src/server/ballisticacore_server.py | 2 +- tools/bacloud | 2 +- tools/efro/error.py | 6 +++--- tools/efrotools/snippets.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/src/server/ballisticacore_server.py b/assets/src/server/ballisticacore_server.py index f0f539d0..1ca525c5 100755 --- a/assets/src/server/ballisticacore_server.py +++ b/assets/src/server/ballisticacore_server.py @@ -365,5 +365,5 @@ if __name__ == '__main__': ServerManagerApp().run_interactive() except CleanError as clean_exc: # For clean errors, do a simple print and fail; no tracebacks/etc. - clean_exc.print() + clean_exc.pretty_print() sys.exit(1) diff --git a/tools/bacloud b/tools/bacloud index 46d7924a..65efdff2 100755 --- a/tools/bacloud +++ b/tools/bacloud @@ -440,5 +440,5 @@ if __name__ == '__main__': # Can make this optional if a backtrace is ever useful.. sys.exit(-1) except CleanError as exc: - exc.print() + exc.pretty_print() sys.exit(-1) diff --git a/tools/efro/error.py b/tools/efro/error.py index 4777b42f..88bfd7aa 100644 --- a/tools/efro/error.py +++ b/tools/efro/error.py @@ -42,10 +42,10 @@ class CleanError(Exception): more descriptive exception types. """ - def print(self, flush: bool = False) -> None: - """Print the error to stdout, using colored output if available. + def pretty_print(self, flush: bool = False) -> None: + """Print the error to stdout, using red colored output if available. - If the error has no message, nothing will be printed. + If the error has an empty message, prints nothing (not even a newline). """ from efro.terminal import Clr errstr = str(self) diff --git a/tools/efrotools/snippets.py b/tools/efrotools/snippets.py index 71d931c7..3198d5ee 100644 --- a/tools/efrotools/snippets.py +++ b/tools/efrotools/snippets.py @@ -72,7 +72,7 @@ def snippets_main(globs: Dict[str, Any]) -> None: try: funcs[sys.argv[1]]() except CleanError as exc: - exc.print() + exc.pretty_print() sys.exit(-1) else: print('Unknown snippets command: "' + sys.argv[1] + '"',