From 8774eaf1624538d18b374862f403cb1fdb9b25c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Tue, 18 May 2010 07:55:03 +0000 Subject: [PATCH] fetcher: Handle all fetch errors Also show the URI in the error message (not the local path). BUG:FIXED:10948 --- pisi/fetcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pisi/fetcher.py b/pisi/fetcher.py index 2065f7bf..e7ca5cac 100644 --- a/pisi/fetcher.py +++ b/pisi/fetcher.py @@ -151,7 +151,7 @@ class Fetcher: copy_local = 1, user_agent = 'PiSi Fetcher/' + pisi.__version__) except urlgrabber.grabber.URLGrabError, e: - raise FetchError(_('Could not fetch destination file "%s": %s') % (self.archive_file, e)) + raise FetchError(_('Could not fetch destination file "%s": %s') % (self.url.get_uri(), e)) if os.stat(self.partial_file).st_size == 0: os.remove(self.partial_file) @@ -207,7 +207,7 @@ class Fetcher: import urllib2 try: file_obj = urllib2.urlopen(urllib2.Request(self.url.get_uri())) - except urllib2.HTTPError: + except urllib2.URLError: ctx.ui.debug(_("Remote file can not be reached. Previously downloaded part of the file will be removed.")) os.remove(self.partial_file) return None