From 9aeec9988b4c37df515a47eb4288baccb8d6bfb9 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 4 Aug 2013 18:18:02 +1200 Subject: [PATCH] fix api wrapper as CRM_Core_Exception fatals on the PEAR exception getUserMessage despite extending that exception --- api/api.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/api.php b/api/api.php index 76637548ce..60d95f63a2 100644 --- a/api/api.php +++ b/api/api.php @@ -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{ -- 2.25.1