+ my $retry_count=5;
+ while ($response =~ /Error reading from remote server/ and $retry_count > 0) {
+ $mech->get($url);
+ $response = $mech->content;
+ $retry_count--;
+ }
+ if ($retry_count <= 0) {
+ die 'Unable to retreive ids ['.join(',',@current_ids).'] because of a remote server error';
+ }