From: Jeremy Stanley Date: Thu, 10 Apr 2014 19:09:01 +0000 (+0000) Subject: Make exception logging failures more robust X-Git-Tag: 0.0.1~248 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=305d7d93122e1802b2ef840805309627b1f38e6e Make exception logging failures more robust * lib/mudpy/misc.py(excepthook): When an uncaught exception is raised and the attempt to log it fails, try to write it to stdout directly and also mention the new exception details. --- diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 9e6dd99..02db563 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -2463,14 +2463,9 @@ def excepthook(excepttype, value, tracebackdata): # try to log it, if possible try: log(message, 9) - except: - pass - - # try to write it to stderr, if possible - try: - sys.stderr.write(message) - except: - pass + except Exception as e: + # try to write it to stderr, if possible + sys.stderr.write(message + "\nException while logging...\n%s" % e) def sighook(what, where):