Skip to content
Snippets Groups Projects
Commit e156d1cf authored by lobo's avatar lobo
Browse files

Merge pull request #925 from GiantRobot/CRM-12737

CRM-12737 - Return a CiviCRM-looking error if we hit a cURL error.
parents 26ca6381 7a514fb1
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,13 @@ class civicrm_api3 {
//execute post
$result = curl_exec($ch);
// CiviCRM expects to get back a CiviCRM error object.
if (curl_errno($ch)) {
$res = new stdClass;
$res->is_error = 1;
$res->error = array('cURL error' => curl_error($ch));
return $res;
}
curl_close($ch);
return json_decode($result);
// not good, all in get when should be in post.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment