fix api wrapper as CRM_Core_Exception fatals on the PEAR exception getUserMessage...
authoreileen <eileen@fuzion.co.nz>
Sun, 4 Aug 2013 06:18:02 +0000 (18:18 +1200)
committereileen <eileen@fuzion.co.nz>
Sun, 4 Aug 2013 23:32:25 +0000 (11:32 +1200)
api/api.php

index 76637548ce14bd15f3499bf7737436abe82c2364..60d95f63a2d16ad8e0e10342ac19ac4e6bbe752a 100644 (file)
@@ -123,7 +123,12 @@ function civicrm_api($entity, $action, $params, $extra = NULL) {
       $data["sql"] = $error->getDebugInfo();
     }
     if (CRM_Utils_Array::value('debug', $apiRequest['params'])) {
-      $data['debug_info'] = $error->getUserInfo();
+      if(method_exists($e, 'getUserInfo')) {
+        $data['debug_info'] = $error->getUserInfo();
+      }
+      if(method_exists($e, 'getExtraData')) {
+        $data['debug_info'] = $data + $error->getExtraData();
+      }
       $data['trace'] = $e->getTraceAsString();
     }
     else{