From: Jon Goldberg Date: Fri, 1 Dec 2023 20:11:17 +0000 (-0500) Subject: ensure this exception class supports getErrorData X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5a04c02c016dc41f4607f3d2a6b1adee5106f571;p=civicrm-core.git ensure this exception class supports getErrorData --- diff --git a/CRM/Api4/Page/AJAX.php b/CRM/Api4/Page/AJAX.php index a40e990240..3e968cd0f9 100644 --- a/CRM/Api4/Page/AJAX.php +++ b/CRM/Api4/Page/AJAX.php @@ -137,7 +137,7 @@ class CRM_Api4_Page_AJAX extends CRM_Core_Page { $status = $statusMap[get_class($e)] ?? 500; // Send error code (but don't overwrite success code if there are multiple calls and one was successful) $this->httpResponseCode = $this->httpResponseCode ?: $status; - if (CRM_Core_Permission::check('view debug output') || ($e->getErrorData()['show_detailed_error'] ?? FALSE)) { + if (CRM_Core_Permission::check('view debug output') || (method_exists($e, 'getErrorData') && ($e->getErrorData()['show_detailed_error'] ?? FALSE))) { $response['error_code'] = $e->getCode(); $response['error_message'] = $e->getMessage(); if (!empty($params['debug']) && CRM_Core_Permission::check('view debug output')) {