From 852fbc84e78487394ba0ee5b1590ed29aaa730ef Mon Sep 17 00:00:00 2001 From: David Flatz Date: Fri, 3 Aug 2018 17:28:41 +0200 Subject: expose errno since some errors don't necessarily have an errorstring (e.g. when curl couldn't connect to a server because it couldn't assign the requested address because the pool of local ports is exhausted) --- it_url.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it_url.class b/it_url.class index d3aa6df..ea93930 100644 --- a/it_url.class +++ b/it_url.class @@ -261,12 +261,12 @@ function request($p=array()) } } else { $result = $this->result = false; - $this->errstr = curl_error($curl); + $this->errstr = trim("(" . curl_errno($curl) . ") " . curl_error($curl)); $this->curlinfo = curl_getinfo($curl); } if ($got === false && $p['retries'] <= 0) - it::error((array)$p['it_error'] + ['title' => "problem getting $url->url with curl: " . curl_error($curl), 'body' => curl_getinfo($curl)]); + it::error((array)$p['it_error'] + ['title' => "problem getting $url->url with curl: (" . curl_errno($curl) . ") " . curl_error($curl), 'body' => curl_getinfo($curl)]); return $result; } -- cgit v1.2.3