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

Unified Diff: trychange.py

Issue 274031: Check Exception object's argument length in trychange.py. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 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 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: trychange.py
===================================================================
--- trychange.py (revision 28888)
+++ trychange.py (working copy)
@@ -318,11 +318,12 @@
try:
connection = urllib.urlopen(url, urllib.urlencode(values), proxies=proxies)
except IOError, e:
- # TODO(thestig) this probably isn't quite right.
- if values.get('bot') and e[2] == 'got a bad status line':
+ if (values.get('bot') and len(e.args) > 2 and
+ e.args[2] == 'got a bad status line'):
raise NoTryServerAccess('%s is unaccessible. Bad --bot argument?' % url)
else:
- raise NoTryServerAccess('%s is unaccessible.' % url)
+ raise NoTryServerAccess('%s is unaccessible. Reason: %s' % (url,
+ str(e.args)))
if not connection:
raise NoTryServerAccess('%s is unaccessible.' % url)
if connection.read() != 'OK':
« 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