From a39a65eec83a10a5ed18c73b1ec1463fe5d00b49 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 31 Jan 2020 09:30:48 +1300 Subject: [PATCH] Replace fatal with exception --- CRM/Contact/Page/View/UserDashBoard.php | 2 +- CRM/Contribute/Form/Task/Batch.php | 2 +- CRM/Contribute/Form/Task/PDF.php | 2 +- CRM/Event/BAO/Event.php | 2 +- CRM/Event/Form/Registration/Confirm.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index 538dbd9bf1..347824cceb 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -77,7 +77,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { */ public function preProcess() { if (!$this->_contactId) { - CRM_Core_Error::fatal(ts('You must be logged in to view this page.')); + throw new CRM_Core_Exception(ts('You must be logged in to view this page.')); } list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($this->_contactId); diff --git a/CRM/Contribute/Form/Task/Batch.php b/CRM/Contribute/Form/Task/Batch.php index 88ead43639..4a35044f43 100644 --- a/CRM/Contribute/Form/Task/Batch.php +++ b/CRM/Contribute/Form/Task/Batch.php @@ -69,7 +69,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { - CRM_Core_Error::fatal('ufGroupId is missing'); + throw new CRM_Core_Exception('ufGroupId is missing'); } $this->_title = ts('Update multiple contributions') . ' - ' . CRM_Core_BAO_UFGroup::getTitle($ufGroupId); CRM_Utils_System::setTitle($this->_title); diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 20868497c6..9eea32cd4b 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -159,7 +159,7 @@ AND {$this->_componentClause}"; $ids['event'] = CRM_Utils_Array::value('event', $detail); if (!$elements['baseIPN']->validateData($input, $ids, $objects, FALSE)) { - CRM_Core_Error::fatal(); + throw new CRM_Core_Exception('invalid data'); } $contribution = &$objects['contribution']; diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index dabaa2d19b..4de3c0e317 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1749,7 +1749,7 @@ WHERE id = $cfID $customProfile = $additionalIDs = []; if (!$participantId) { - CRM_Core_Error::fatal(ts('Cannot find participant ID')); + throw new CRM_Core_Exception(ts('Cannot find participant ID')); } //set Ids of Primary Participant also. diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index b57720085c..735679d579 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -553,7 +553,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { list($result, $value) = $this->processPayment($payment, $value); } else { - CRM_Core_Error::fatal($paymentObjError); + throw new CRM_Core_Exception($paymentObjError); } } @@ -793,7 +793,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $this->processPayment($payment, $primaryParticipant); } else { - CRM_Core_Error::fatal($paymentObjError); + throw new CRM_Core_Exception($paymentObjError); } } } -- 2.25.1