From 0db7e8102731bec67c48426d85c43981aba431aa Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Sun, 9 Nov 2008 12:04:23 -0800 Subject: [PATCH] Print a traceback on unknown exceptions Unknown exceptions were already handled by the code, but they would not lead to a traceback, making errors harder to find. Now we add a traceback to the log to help in tracking them down. Signed-off-by: Ira W. Snyder --- rarslave.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rarslave.py b/rarslave.py index 1a7e4bc..5d9824d 100755 --- a/rarslave.py +++ b/rarslave.py @@ -323,8 +323,12 @@ def runDirectory(directory, files, options): for cs in sets: try: runEachType(cs, options) - except: + except Exception, e: + import traceback logging.error('Unknown Exception: %s' % cs.parityFile) + logging.error('===== BEGIN Bactrace =====') + [logging.error(l) for l in traceback.format_exc(e).split('\n')] + logging.error('===== END Bactrace =====') ################################################################################ -- 2.25.1