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

Unified Diff: third_party/upload.py

Issue 1063143003: upload.py: Fix immutable exception attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 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: third_party/upload.py
diff --git a/third_party/upload.py b/third_party/upload.py
index 1101f26b069b8972459ba3e40cfc93149955c55c..a36aa9c8882403fe033e1f87c392616a102e0e40 100755
--- a/third_party/upload.py
+++ b/third_party/upload.py
@@ -397,9 +397,10 @@ class AbstractRpcServer(object):
e = exc
if e:
print >> sys.stderr, ''
+ error_message = e.reason
if error_map:
- e.reason = error_map.get(e.reason, e.reason)
- if e.reason == "BadAuthentication":
+ error_message = error_map.get(error_message, error_message)
+ if error_message == "BadAuthentication":
if e.info == "InvalidSecondFactor":
print >> sys.stderr, (
"Use an application-specific password instead "
@@ -408,26 +409,26 @@ class AbstractRpcServer(object):
"support/accounts/bin/answer.py?answer=185833")
else:
print >> sys.stderr, "Invalid username or password."
- elif e.reason == "CaptchaRequired":
+ elif error_message == "CaptchaRequired":
print >> sys.stderr, (
"Please go to\n"
"https://www.google.com/accounts/DisplayUnlockCaptcha\n"
"and verify you are a human. Then try again.\n"
"If you are using a Google Apps account the URL is:\n"
"https://www.google.com/a/yourdomain.com/UnlockCaptcha")
- elif e.reason == "NotVerified":
+ elif error_message == "NotVerified":
print >> sys.stderr, "Account not verified."
- elif e.reason == "TermsNotAgreed":
+ elif error_message == "TermsNotAgreed":
print >> sys.stderr, "User has not agreed to TOS."
- elif e.reason == "AccountDeleted":
+ elif error_message == "AccountDeleted":
print >> sys.stderr, "The user account has been deleted."
- elif e.reason == "AccountDisabled":
+ elif error_message == "AccountDisabled":
print >> sys.stderr, "The user account has been disabled."
break
- elif e.reason == "ServiceDisabled":
+ elif error_message == "ServiceDisabled":
print >> sys.stderr, ("The user's access to the service has been "
"disabled.")
- elif e.reason == "ServiceUnavailable":
+ elif error_message == "ServiceUnavailable":
print >> sys.stderr, "The service is not available; try again later."
else:
# Unknown error.
« 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