diff --git a/api/v3/TwingleDonation/Cancel.php b/api/v3/TwingleDonation/Cancel.php index d2bba26..e3dee49 100644 --- a/api/v3/TwingleDonation/Cancel.php +++ b/api/v3/TwingleDonation/Cancel.php @@ -150,7 +150,7 @@ function civicrm_api3_twingle_donation_Cancel($params) { $result = civicrm_api3_create_success($contribution); } - catch (CiviCRM_API3_Exception $exception) { + catch (Exception $exception) { $result = civicrm_api3_create_error($exception->getMessage()); } diff --git a/api/v3/TwingleDonation/Endrecurring.php b/api/v3/TwingleDonation/Endrecurring.php index 318b115..12c93c4 100644 --- a/api/v3/TwingleDonation/Endrecurring.php +++ b/api/v3/TwingleDonation/Endrecurring.php @@ -139,7 +139,7 @@ function civicrm_api3_twingle_donation_endrecurring($params) { $result = civicrm_api3_create_success($contribution); } - catch (CiviCRM_API3_Exception $exception) { + catch (Exception $exception) { $result = civicrm_api3_create_error($exception->getMessage()); } diff --git a/api/v3/TwingleDonation/Submit.php b/api/v3/TwingleDonation/Submit.php index 5856996..a0dc342 100644 --- a/api/v3/TwingleDonation/Submit.php +++ b/api/v3/TwingleDonation/Submit.php @@ -727,14 +727,16 @@ function civicrm_api3_twingle_donation_Submit($params) { } catch (Exception $ex) { // TODO: more error handling? Civi::log()->debug("Twingle membership postprocessing call {$pp_entity}.{$pp_action} has failed: " . $ex->getMessage()); + throw new Exception( + E::ts("Twingle membership postprocessing call has failed, see log for more information") + ); } } - } $result = civicrm_api3_create_success($result_values); } - catch (CiviCRM_API3_Exception $exception) { + catch (Exception $exception) { $result = civicrm_api3_create_error($exception->getMessage()); }