diff options
author | Shawn O. Pearce <sop@google.com> | 2009-08-22 18:39:49 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-08-22 18:41:16 -0700 |
commit | d2dfac81ad6a060179b4b2289060af2dc7a5cdfd (patch) | |
tree | c783e72b72e7c199ef39d036bb94ca15ec7c59ec /subcmds/upload.py | |
parent | 47199010671a6724e18f061f4da63dcd46e3f354 (diff) | |
download | git-repo-d2dfac81ad6a060179b4b2289060af2dc7a5cdfd.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>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 8e3d2723..2ab6a484 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -273,15 +273,19 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
273 | have_errors = True | 273 | have_errors = True |
274 | 274 | ||
275 | print >>sys.stderr, '' | 275 | print >>sys.stderr, '' |
276 | print >>sys.stderr, '--------------------------------------------' | 276 | print >>sys.stderr, '----------------------------------------------------------------------' |
277 | 277 | ||
278 | if have_errors: | 278 | if have_errors: |
279 | for branch in todo: | 279 | for branch in todo: |
280 | if not branch.uploaded: | 280 | if not branch.uploaded: |
281 | print >>sys.stderr, '[FAILED] %-15s %-15s (%s)' % ( | 281 | if len(str(branch.error)) <= 30: |
282 | fmt = ' (%s)' | ||
283 | else: | ||
284 | fmt = '\n (%s)' | ||
285 | print >>sys.stderr, ('[FAILED] %-15s %-15s' + fmt) % ( | ||
282 | branch.project.relpath + '/', \ | 286 | branch.project.relpath + '/', \ |
283 | branch.name, \ | 287 | branch.name, \ |
284 | branch.error) | 288 | str(branch.error)) |
285 | print >>sys.stderr, '' | 289 | print >>sys.stderr, '' |
286 | 290 | ||
287 | for branch in todo: | 291 | for branch in todo: |