From d34b1f5b35c83105cae394936dcf0f8af8b02ed6 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Mon, 14 Feb 2022 13:27:27 +0100 Subject: [PATCH] error printer can be used for exception and not-exception errors --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 69daa60..5175d6e 100644 --- a/main.py +++ b/main.py @@ -14,9 +14,12 @@ def warn(message): print("WARNING: "+str(message), file=sys.stderr) traceback.print_stack() -def error(message, handle_gracefully=True): +def error(message, is_exception=True, handle_gracefully=True): print("ERROR: "+str(message), file=sys.stderr) - traceback.print_stack() + if is_exception: + traceback.print_exc() + else: + traceback.print_stack() if handle_gracefully: pass else: