Commit c44a43ce authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make sure curl errors get dumped to the logs (bug 3126)

parent 9280182a
......@@ -83,8 +83,9 @@ class Client {
$timestamp_receive = time();
$remote_timestamp = null;
if ($this->rawresponse == false) {
throw new XmlrpcClientException('Curl error: '.curl_errno($ch) .':'. curl_error($ch));
$curl_errno = curl_errno($ch);
if ($curl_errno || $this->rawresponse == false) {
throw new XmlrpcClientException('Curl error: ' . $curl_errno . ': ' . curl_error($ch));
return false;
}
......
......@@ -2829,6 +2829,9 @@ function mahara_http_request($config) {
$result->info = curl_getinfo($ch);
$result->error = curl_error($ch);
if ($curl_errno = curl_errno($ch)) {
log_warn('Curl error: ' . $curl_errno . ': ' . $result->error);
}
curl_close($ch);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment