- Print an error code if FileGetter fails to get a file
authorRalf Ertzinger <sun@ryoko.camperquake.de>
Sat, 5 Jan 2008 23:26:16 +0000 (00:26 +0100)
committerRalf Ertzinger <sun@ryoko.camperquake.de>
Sat, 5 Jan 2008 23:26:16 +0000 (00:26 +0100)
videosite/FileGetter.pm

index 8c3420d..b3c2660 100644 (file)
@@ -31,6 +31,7 @@ sub get {
     my $video = shift;
     my $dlfile;
     my $dirname;
+    my $res;
 
     $dlfile = sprintf($self->_getval('FILEPATTERN'),
         $self->_encode($video->{'SOURCE'}),
@@ -47,8 +48,8 @@ sub get {
 
     $self->debug('Going to download %s to %s', $video->{'DLURL'}, $dlfile);
 
-    if (200 != LWP::Simple::mirror($video->{'DLURL'}, $dlfile)) {
-        $self->error('Could not download %s to %s', $video->{'DLURL'}, $dlfile);
+    if (200 != ($res = LWP::Simple::mirror($video->{'DLURL'}, $dlfile))) {
+        $self->error('Could not download %s to %s (%s)', $video->{'DLURL'}, $dlfile, $res);
         return 0;
     }