Skip to content
Snippets Groups Projects
Commit 849a5f61 authored by mattwire's avatar mattwire
Browse files

Catch TypeError etc. when running API actions

parent 6164ecbd
No related branches found
No related tags found
Loading
......@@ -95,7 +95,7 @@ abstract class CRM_CivirulesActions_Generic_Api extends CRM_Civirules_Action {
try {
civicrm_api3($entity, $action, $params);
}
catch (Exception $e) {
catch (Throwable $e) {
$message = "Civirules api3 action exception: {$e->getMessage()}. API call: {$entity}.{$action} with params: " . print_r($params, TRUE);
\Civi::log('civirules')->error($message);
throw new Exception($message);
......@@ -106,7 +106,7 @@ abstract class CRM_CivirulesActions_Generic_Api extends CRM_Civirules_Action {
try {
civicrm_api4($entity, $action, $params);
}
catch (Exception $e) {
catch (Throwable $e) {
$message = "Civirules api4 action exception: {$e->getMessage()}. API call: {$entity}.{$action} with params: " . print_r($params, TRUE);
\Civi::log('civirules')->error($message);
throw new Exception($message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment