Unverified Commit c73cec96 authored by Tiago Grego's avatar Tiago Grego Committed by GitHub
Browse files

Merge pull request #74 from imran-ebi/master

Check response status code instead of message for file fetch requests
parents 92630dd2 0f8df026
......@@ -341,7 +341,7 @@ sub fetch_file {
my $dest = $args->{'destination_path'} ? $args->{'destination_path'}."$filename" : "/tmp/$filename";
my $response = $ua->mirror($file_url, $dest);
return $dest if ($response->{_msg} eq 'OK');
return $dest if ($response->{_rc} == 200);
if($args->{'nice'}) {
return {'error' => "Cannot download file ($file_url). HTTP request error code ".$response->{_rc}};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment