Print a traceback on unknown exceptions
authorIra W. Snyder <devel@irasnyder.com>
Sun, 9 Nov 2008 20:04:23 +0000 (12:04 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Sun, 9 Nov 2008 20:04:23 +0000 (12:04 -0800)
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 <devel@irasnyder.com>
rarslave.py

index 1a7e4bc..5d9824d 100755 (executable)
@@ -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 =====')
 
 ################################################################################