Merge pull request #16626 from pradpnayak/lineItemFixes
[civicrm-core.git] / CRM / Campaign / BAO / Petition.php
index 406b38f70f8bf4c70ff52a8671bf0b3608b1804b..72e2151a640f88cd0311b723df4243efee7a7227 100644 (file)
@@ -266,8 +266,7 @@ AND         tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
       return TRUE;
     }
     else {
-      CRM_Core_Error::fatal(ts('Petition Id and/or Activity Id is not of the type Positive.'));
-      return FALSE;
+      throw new CRM_Core_Exception(ts('Petition Id and/or Activity Id is not of the type Positive.'));
     }
   }
 
@@ -561,7 +560,7 @@ AND         tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
     $petitionInfo = [];
     CRM_Campaign_BAO_Survey::retrieve($petitionParams, $petitionInfo);
     if (empty($petitionInfo)) {
-      CRM_Core_Error::fatal('Petition doesn\'t exist.');
+      throw new CRM_Core_Exception('Petition doesn\'t exist.');
     }
 
     //get the default domain email address.