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

Unified Diff: git_cl.py

Issue 9091009: Provide a friendlier error message after Rietveld issue deletion. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 8 years, 12 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
===================================================================
--- git_cl.py (revision 116355)
+++ git_cl.py (working copy)
@@ -446,8 +446,23 @@
def GetDescription(self, pretty=False):
if not self.has_description:
if self.GetIssue():
- self.description = self.RpcServer().get_description(
- int(self.GetIssue())).strip()
+ issue = int(self.GetIssue())
+ try:
+ self.description = self.RpcServer().get_description(issue).strip()
+ except urllib2.HTTPError, e:
+ if e.code == 404:
+ DieWithError(
+ ('\nWhile fetching the description for issue %d, received a '
+ '404 (not found)\n'
+ 'error. It is likely that you deleted this '
+ 'issue on the server. If this is the\n'
+ 'case, please run\n\n'
+ ' git cl issue 0\n\n'
+ 'to clear the association with the deleted issue. Then run '
+ 'this command again.') % issue)
+ else:
+ DieWithError(
+ '\nFailed to fetch issue description. HTTP error ' + e.code)
self.has_description = True
if pretty:
wrapper = textwrap.TextWrapper()
« 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