From 8c86436125d34e1dc322c475f7d460cad682cdd7 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Tue, 21 May 2024 10:25:42 +0200 Subject: more meaningful error message in title than 0 No Error --- it_url.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it_url.class b/it_url.class index fac7e0c..953562d 100644 --- a/it_url.class +++ b/it_url.class @@ -369,7 +369,7 @@ function request($p=array()) else { $result = $this->result = false; - $this->errstr = trim("(" . curl_errno($curl) . ") " . curl_error($curl)); + $this->errstr = trim(curl_strerror(curl_errno($curl)) . "(" . curl_errno($curl) . ") " . curl_error($curl)); } if ($p['verbose']) @@ -381,7 +381,7 @@ function request($p=array()) if ($got === false && $p['retries'] <= 0) { - it::error((array)$p['it_error'] + ['title' => "problem " . ($p['method'] ?: "gett") . "ing $url->url with curl: " . curl_strerror(curl_errno($curl)) . " (" . curl_errno($curl) . ") " . curl_error($curl), 'body' => ['Error description' => $this->errstr] + curl_getinfo($curl) + ($p['verbose'] ? ['verbose' => $this->verbose] : [])]); + it::error((array)$p['it_error'] + ['title' => "problem " . ($p['method'] ?: "gett") . "ing $url->url: " . $this->errstr, 'body' => curl_getinfo($curl) + ($p['verbose'] ? ['verbose' => $this->verbose] : [])]); } return $result; -- cgit v1.2.3