summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-08-31 15:33:15 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-08-31 15:33:15 +0100
commit366f79fe42632336f223110eb95057586672dc3e (patch)
treea78897f3b41ccdf1098a51f15f83f952b0f55543
parent77a24e14c8e24654e72e8b840aeda15238033c5c (diff)
downloadlorry-366f79fe42632336f223110eb95057586672dc3e.tar.gz
Improve reporting of exceptions during mirroring
-rwxr-xr-xlorry12
1 files changed, 7 insertions, 5 deletions
diff --git a/lorry b/lorry
index 6ddb9c3..cbd41ae 100755
--- a/lorry
+++ b/lorry
@@ -24,6 +24,7 @@ import string
import sys
from datetime import datetime
import shutil
+import traceback
__version__ = '0.0'
@@ -92,13 +93,14 @@ class Lorry(cliapp.Application):
with open(arg) as f:
specs = json.load(f)
for name in sorted(specs.keys()):
- try:
- self.progress('Getting: %s' % name)
+ self.progress('Getting: %s' % name)
+ try:
self.gitify(name, specs[name])
- except Exception,e:
+ except Exception,e:
status += 1
- print 'Exception:',e
- logging.debug('Mirroring Error: %s' %e)
+ sys.stderr.write(
+ 'Error mirroring:\n%s' % traceback.format_exc())
+ logging.error(traceback.format_exc())
if status > 0 :
logging.debug('Total Mirrors failed: %d' %status)
status = 1