Browse Source

Add cUrl error message and code to the debugMessage (#711)

hunhejj 6 years ago
parent
commit
d92da8f0f7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/contents.php

+ 3 - 1
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;
 }