summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-08-22 18:39:49 -0700
committerShawn O. Pearce <sop@google.com>2011-01-09 17:39:22 -0800
commitf00e0ce556fc22fef180c74a9d78f1908d9aeb0b (patch)
tree7ad50d7511c963ec7daae4017849db7b0a06e089 /subcmds/upload.py
parent1b5a4a0c5de5fdaa4f8907357a0aa80e365dd199 (diff)
downloadgit-repo-f00e0ce556fc22fef180c74a9d78f1908d9aeb0b.tar.gz
upload: Catch and cleanly report connectivity errors
Instead of giving a Python backtrace when there is a connectivity problem during repo upload, report that we cannot access the host, and why, with a halfway decent error message. Bug: REPO-45 Change-Id: I9a45b387e86e48073a2d99bd6d594c1a7d6d99d4 Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit d2dfac81ad6a060179b4b2289060af2dc7a5cdfd)
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r--subcmds/upload.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 1964bffa..20822096 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -283,15 +283,19 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
283 have_errors = True 283 have_errors = True
284 284
285 print >>sys.stderr, '' 285 print >>sys.stderr, ''
286 print >>sys.stderr, '--------------------------------------------' 286 print >>sys.stderr, '----------------------------------------------------------------------'
287 287
288 if have_errors: 288 if have_errors:
289 for branch in todo: 289 for branch in todo:
290 if not branch.uploaded: 290 if not branch.uploaded:
291 print >>sys.stderr, '[FAILED] %-15s %-15s (%s)' % ( 291 if len(str(branch.error)) <= 30:
292 fmt = ' (%s)'
293 else:
294 fmt = '\n (%s)'
295 print >>sys.stderr, ('[FAILED] %-15s %-15s' + fmt) % (
292 branch.project.relpath + '/', \ 296 branch.project.relpath + '/', \
293 branch.name, \ 297 branch.name, \
294 branch.error) 298 str(branch.error))
295 print >>sys.stderr, '' 299 print >>sys.stderr, ''
296 300
297 for branch in todo: 301 for branch in todo: