From 560a6a071ede2d2f75d1a9ccc1987324f25d5f56 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 13 Jun 2020 13:18:11 +1200 Subject: [PATCH] dev/financial#131 Give deprecation notice if the payment processor returns an error This notice will show up on dev sites & should highlight the expectation that processors throw errors --- CRM/Core/Payment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index c4e4deb2c583..ab955db1497f 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1375,6 +1375,7 @@ public function doPayment(&$params, $component = 'contribute') { } } if (is_a($result, 'CRM_Core_Error')) { + CRM_Core_Error::deprecatedFunctionWarning('payment processors should throw exceptions rather than return errors'); throw new PaymentProcessorException(CRM_Core_Error::getMessages($result)); } return $result;