summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-05-26 03:30:30 +0200
committerUrban Müller2020-05-26 03:30:30 +0200
commit98b23955143c909892bd2006bd3f0cad32f690db (patch)
treefea2eb0857ca18a9df570de2cff5a962ed080658
parent93bf725ddad4afa053f41c886735208ce3c39b2d (diff)
downloaditools-98b23955143c909892bd2006bd3f0cad32f690db.tar.gz
itools-98b23955143c909892bd2006bd3f0cad32f690db.tar.bz2
itools-98b23955143c909892bd2006bd3f0cad32f690db.zip
allow custom errors on format violations (e.g. timewindow)
-rw-r--r--it_url.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class
index 5d7b4dd..29429d2 100644
--- a/it_url.class
+++ b/it_url.class
@@ -81,7 +81,7 @@ function is_reachable($timeout = 5)
static function _postprocess($data, $p)
{
if ($p['postprocess'])
- $data = ($t = $p['postprocess']($data, ['it_error' => $p['retries'] > 0 ? false : ['title' => "invalid content from " . $p['url']]])) && $p['checkonly'] ? $data : $t;
+ $data = ($t = $p['postprocess']($data, ['it_error' => $p['retries'] > 0 ? false : (array)$p['it_error'] + ['title' => "invalid content from " . $p['url']]])) && $p['checkonly'] ? $data : $t;
return $data;
}
@@ -409,7 +409,7 @@ static function get_multi($p=null)
$key = $keys[$info['handle']];
$content = curl_multi_getcontent($info['handle']);
if (isset($p['postprocess']))
- $content = $p['postprocess']($content, ['it_error' => $retries[$key] < $p['retries'] ? false : ['title' => "invalid content from " . $urls[$key]]]);
+ $content = $p['postprocess']($content, ['it_error' => $retries[$key] < $p['retries'] ? false : (array)$p['it_error'] + ['title' => "invalid content from " . $urls[$key]]]);
EDC('reqtimings', $key, $info['result'], (gettimeofday(true) - $start) * 1000);
if ($info['result'] == CURLE_OK && $content !== null) {