From a773a8c5d026cacc769de06cf7d5d95261247a17 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 22 Oct 2025 18:20:24 -0400 Subject: [PATCH] Replace reference to deprecated exception class The api-specific exception classes have been deprecated and will soon be removed from core. They are identical to CRM_Core_Exception. --- api/v3/ChatAction.php | 6 +++--- api/v3/ChatCache.php | 6 +++--- api/v3/ChatConversationType.php | 6 +++--- api/v3/ChatHear.php | 6 +++--- api/v3/ChatQuestion.php | 6 +++--- api/v3/ChatUser.php | 6 +++--- api/v3/Contact/Say.php | 4 ++-- api/v3/Contact/StartConversation.php | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/api/v3/ChatAction.php b/api/v3/ChatAction.php index 07268ad..62f32cf 100644 --- a/api/v3/ChatAction.php +++ b/api/v3/ChatAction.php @@ -18,7 +18,7 @@ function _civicrm_api3_chat_action_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_action_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -29,7 +29,7 @@ function civicrm_api3_chat_action_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_action_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -40,7 +40,7 @@ function civicrm_api3_chat_action_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_action_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/ChatCache.php b/api/v3/ChatCache.php index 68905c8..4c83e30 100644 --- a/api/v3/ChatCache.php +++ b/api/v3/ChatCache.php @@ -18,7 +18,7 @@ function _civicrm_api3_chat_cache_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_cache_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -29,7 +29,7 @@ function civicrm_api3_chat_cache_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_cache_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -40,7 +40,7 @@ function civicrm_api3_chat_cache_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_cache_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/ChatConversationType.php b/api/v3/ChatConversationType.php index 64e00b7..961b626 100644 --- a/api/v3/ChatConversationType.php +++ b/api/v3/ChatConversationType.php @@ -19,7 +19,7 @@ function _civicrm_api3_chat_conversation_type_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_conversation_type_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -30,7 +30,7 @@ function civicrm_api3_chat_conversation_type_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_conversation_type_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -41,7 +41,7 @@ function civicrm_api3_chat_conversation_type_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_conversation_type_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/ChatHear.php b/api/v3/ChatHear.php index f16f67c..30f9681 100644 --- a/api/v3/ChatHear.php +++ b/api/v3/ChatHear.php @@ -18,7 +18,7 @@ function _civicrm_api3_chat_hear_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_hear_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -29,7 +29,7 @@ function civicrm_api3_chat_hear_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_hear_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -40,7 +40,7 @@ function civicrm_api3_chat_hear_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_hear_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/ChatQuestion.php b/api/v3/ChatQuestion.php index 65e761d..7bfbba8 100644 --- a/api/v3/ChatQuestion.php +++ b/api/v3/ChatQuestion.php @@ -18,7 +18,7 @@ function _civicrm_api3_chat_question_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_question_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -29,7 +29,7 @@ function civicrm_api3_chat_question_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_question_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -40,7 +40,7 @@ function civicrm_api3_chat_question_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_question_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/ChatUser.php b/api/v3/ChatUser.php index 46ee47d..f61245b 100644 --- a/api/v3/ChatUser.php +++ b/api/v3/ChatUser.php @@ -18,7 +18,7 @@ function _civicrm_api3_chat_user_create_spec(&$spec) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_user_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -29,7 +29,7 @@ function civicrm_api3_chat_user_create($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_user_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -40,7 +40,7 @@ function civicrm_api3_chat_user_delete($params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_chat_user_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/Contact/Say.php b/api/v3/Contact/Say.php index b3b54bd..cfb037c 100644 --- a/api/v3/Contact/Say.php +++ b/api/v3/Contact/Say.php @@ -12,7 +12,7 @@ function civicrm_api3_contact_say($params) { $missingFields = array_diff($required, array_keys($params)); if(count($missingFields)){ - throw new API_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields)); + throw new CRM_Core_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields)); } try { @@ -21,7 +21,7 @@ function civicrm_api3_contact_say($params) { 'contact_id' => $params['id'] ]); } catch (\Exception $e) { - throw new API_Exception("Could not find {$params['service']} user for contact_id {$params['id']}"); + throw new CRM_Core_Exception("Could not find {$params['service']} user for contact_id {$params['id']}"); } $botman = CRM_Chat_Botman::get($params['service']); diff --git a/api/v3/Contact/StartConversation.php b/api/v3/Contact/StartConversation.php index f722bf3..f89e4ee 100644 --- a/api/v3/Contact/StartConversation.php +++ b/api/v3/Contact/StartConversation.php @@ -13,7 +13,7 @@ function civicrm_api3_contact_start_conversation($params) { $missingFields = array_diff($required, array_keys($params)); if(count($missingFields)){ - throw new API_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields)); + throw new CRM_Core_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields)); } // Check user has account with service @@ -23,7 +23,7 @@ function civicrm_api3_contact_start_conversation($params) { 'contact_id' => $params['id'] ]); } catch (\Exception $e) { - throw new API_Exception("Could not find {$params['service']} user for contact_id {$params['id']}"); + throw new CRM_Core_Exception("Could not find {$params['service']} user for contact_id {$params['id']}"); } $conversationType = CRM_Chat_BAO_ChatConversationType::findById($params['conversation_type_id']);