winfreed.py: print the URL when the download fails
authorAntonio Ospite <ospite@studenti.unina.it>
Sat, 16 Jun 2012 12:33:36 +0000 (14:33 +0200)
committerAntonio Ospite <ospite@studenti.unina.it>
Sat, 16 Jun 2012 12:33:36 +0000 (14:33 +0200)
This makes it easier to understand what pkg failed.

winfreed.py

index 6a5e7b5..ca3cd32 100755 (executable)
@@ -74,9 +74,9 @@ def download_file(src_url, dest_dir):
         response = urllib2.urlopen(src_url)
     except Exception, e:
         if hasattr(e, 'reason'):
         response = urllib2.urlopen(src_url)
     except Exception, e:
         if hasattr(e, 'reason'):
-            print 'Download failed. Reason: ', e.reason
+            print 'Downloading from', src_url, 'failed. Reason: ', e.reason
         elif hasattr(e, 'code'):
         elif hasattr(e, 'code'):
-            print 'Download failed. Error code: ', e.code
+            print 'Downloading from', src_url, 'failed. Error code: ', e.code
         return
 
     # get the final URL after possible redirect have been followed
         return
 
     # get the final URL after possible redirect have been followed