Merge pull request #116 from lilydjwg/master
format exception using traceback.format_exception_only for error messages
This commit is contained in:
commit
d379935a56
@ -689,7 +689,6 @@ class IMAPServer:
|
|||||||
OfflineImapError.ERROR.CRITICAL)
|
OfflineImapError.ERROR.CRITICAL)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
e.args[0][:35]
|
|
||||||
|
|
||||||
# re-raise all other errors
|
# re-raise all other errors
|
||||||
raise
|
raise
|
||||||
|
@ -538,10 +538,11 @@ class UIBase:
|
|||||||
exitstatus = 1
|
exitstatus = 1
|
||||||
while not self.exc_queue.empty():
|
while not self.exc_queue.empty():
|
||||||
msg, exc, exc_traceback = self.exc_queue.get()
|
msg, exc, exc_traceback = self.exc_queue.get()
|
||||||
|
exc_str = "".join(traceback.format_exception_only(type(exc), exc))
|
||||||
if msg:
|
if msg:
|
||||||
self.warn("ERROR: %s\n %s" % (msg, exc))
|
self.warn("ERROR: %s\n %s" % (msg, exc_str))
|
||||||
else:
|
else:
|
||||||
self.warn("ERROR: %s" % exc)
|
self.warn("ERROR: %s" % exc_str)
|
||||||
if exc_traceback:
|
if exc_traceback:
|
||||||
self.warn("\nTraceback:\n%s" % "".join(
|
self.warn("\nTraceback:\n%s" % "".join(
|
||||||
traceback.format_tb(exc_traceback)))
|
traceback.format_tb(exc_traceback)))
|
||||||
|
Loading…
Reference in New Issue
Block a user