error printer can be used for exception and not-exception errors
parent
73c37988f4
commit
d34b1f5b35
7
main.py
7
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:
|
||||
|
|
Reference in New Issue