From d92da8f0f734794cdeb0b98d8e98f6c96d65de37 Mon Sep 17 00:00:00 2001 From: hunhejj Date: Sun, 10 Jun 2018 22:08:45 +0200 Subject: [PATCH] Add cUrl error message and code to the debugMessage (#711) --- lib/contents.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/contents.php b/lib/contents.php index 591e38e..416fb7d 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -22,10 +22,12 @@ function getContents($url, $header = array(), $opts = array()){ } $content = curl_exec($ch); + $curlError = curl_error($ch); + $curlErrno = curl_errno($ch); curl_close($ch); if($content === false) - debugMessage('Cant\'t download ' . $url); + debugMessage('Cant\'t download ' . $url . ' cUrl error: ' . $curlError . ' (' . $curlErrno . ')'); return $content; }