From da34c035df9a140bbdfb40ac6ebe7354da3f5494 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 11 Aug 2017 14:35:00 +0200 Subject: dont report errs if retries left --- it_url.class | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/it_url.class b/it_url.class index 081c9ee..61f4475 100644 --- a/it_url.class +++ b/it_url.class @@ -262,7 +262,7 @@ function request($p=array()) if (time() >= $endtime) { $result = $this->result = false; - $errstr = $this->errstr = "totaltimeout (" . $p['totaltimeout'] . ") reached"; + $errstr = $this->errstr = "totaltimeout " . $p['totaltimeout'] . " reached"; } if ($p['maxlength'] && (strlen($this->data) + $len > $p['maxlength'])) { @@ -270,8 +270,8 @@ function request($p=array()) $errstr = $this->errstr = "maxlength reached"; } - if ($result === false) - it::error((array)$p['it_error'] + ['title' => "problem (timeout?) getting $url->url " . $errstr]); + if ($result === false && $p['retries'] <= 0) + it::error((array)$p['it_error'] + ['title' => "problem (" . ($errstr ?: "timeout?") . ") getting $url->url "]); return $result; } @@ -367,7 +367,7 @@ function request_curl($p=array()) $errstr = $this->errstr = curl_error($curl); } - if ($got === false) + if ($got === false && $p['retries'] <= 0) it::error((array)$p['it_error'] + ['title' => "problem getting $url->url with curl: " . curl_error($curl)]); return $result; -- cgit v1.2.3