Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: rietveld.py

Issue 1387833002: Print response from the server on HTTP errors from Rietveld (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Defines class Rietveld to easily access a rietveld instance. 5 """Defines class Rietveld to easily access a rietveld instance.
6 6
7 Security implications: 7 Security implications:
8 8
9 The following hypothesis are made: 9 The following hypothesis are made:
10 - Rietveld enforces: 10 - Rietveld enforces:
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 ): 442 ):
443 # Usually internal GAE flakiness. 443 # Usually internal GAE flakiness.
444 raise 444 raise
445 except ssl.SSLError, e: 445 except ssl.SSLError, e:
446 if retry >= (self._maxtries - 1): 446 if retry >= (self._maxtries - 1):
447 raise 447 raise
448 if not 'timed out' in str(e): 448 if not 'timed out' in str(e):
449 raise 449 raise
450 # If reaching this line, loop again. Uses a small backoff. 450 # If reaching this line, loop again. Uses a small backoff.
451 time.sleep(min(10, 1+retry*2)) 451 time.sleep(min(10, 1+retry*2))
452 except urllib2.HTTPError as e:
453 print 'Request to %s failed: %s' % (e.geturl(), e.read())
454 raise
452 finally: 455 finally:
453 upload.ErrorExit = old_error_exit 456 upload.ErrorExit = old_error_exit
454 457
455 # DEPRECATED. 458 # DEPRECATED.
456 Send = get 459 Send = get
457 460
458 461
459 class OAuthRpcServer(object): 462 class OAuthRpcServer(object):
460 def __init__(self, 463 def __init__(self,
461 host, 464 host,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 self, issue, patchset, reason, clobber, revision, builders_and_tests, 730 self, issue, patchset, reason, clobber, revision, builders_and_tests,
728 master=None, category='cq'): 731 master=None, category='cq'):
729 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 732 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
730 (builders_and_tests, issue)) 733 (builders_and_tests, issue))
731 734
732 def trigger_distributed_try_jobs( # pylint:disable=R0201 735 def trigger_distributed_try_jobs( # pylint:disable=R0201
733 self, issue, patchset, reason, clobber, revision, masters, 736 self, issue, patchset, reason, clobber, revision, masters,
734 category='cq'): 737 category='cq'):
735 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % 738 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
736 (masters, issue)) 739 (masters, issue))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698