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

Unified Diff: git_cl.py

Issue 1773963002: git-cl-try: print proper access denied error msg (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index d236e8596a8cf832819d6ae39f65d0904b116d4b..7e9e4ae1373ba76220b9d77b8565d73513e51a11 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -252,9 +252,12 @@ def _buildbucket_retry(operation_name, http, *args, **kwargs):
# Buildbucket could return an error even if status==200.
if content_json and content_json.get('error'):
+ error = content_json.get('error')
+ if error.get('code') == 403:
+ raise BuildbucketResponseException(
+ 'Access denied: %s' % error.get('message', ''))
msg = 'Error in response. Reason: %s. Message: %s.' % (
- content_json['error'].get('reason', ''),
- content_json['error'].get('message', ''))
+ error.get('reason', ''), error.get('message', ''))
raise BuildbucketResponseException(msg)
if response.status == 200:
« 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