From 216b26cbf208a7adbc41252e923999c7f9afa7bd Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 1 May 2012 20:38:14 -0400 Subject: [PATCH] hide traceback on config validation failure a fully traceback is needlessly scary. use --verbose to see the traceback. --- overviewer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/overviewer.py b/overviewer.py index 7b1226e..55400ce 100755 --- a/overviewer.py +++ b/overviewer.py @@ -246,8 +246,12 @@ dir but you forgot to put quotes around the directory, since it contains spaces. # Now parse and return the validated config try: config = mw_parser.get_validated_config() - except Exception: - logging.exception("An error was encountered with your configuration. See the info below.") + except Exception as ex: + if options.verbose: + logging.exception("An error was encountered with your configuration. See the info below.") + else: # no need to print scary traceback! just + logging.error("An error was encountered with your configuration.") + logging.error(str(ex)) return 1