From ed3bf90356d1f2940796e5934c35888525163881 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 25 Sep 2020 16:18:20 +0100 Subject: [PATCH] Remove double exception handling in repeattransaction --- api/v3/Contribution.php | 42 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index e82dbcc0d2..26ac4fa58f 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -610,31 +610,27 @@ function civicrm_api3_contribution_repeattransaction($params) { 'return' => 'payment_processor_id', 'id' => $contribution->contribution_recur_id, ]); - try { - if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) { - throw new API_Exception('failed to load related objects'); - } - - unset($contribution->id, $contribution->receive_date, $contribution->invoice_id); - $contribution->receive_date = $params['receive_date']; - - $passThroughParams = [ - 'trxn_id', - 'total_amount', - 'campaign_id', - 'fee_amount', - 'financial_type_id', - 'contribution_status_id', - 'membership_id', - 'payment_processor_id', - ]; - $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL)); - return _ipn_process_transaction($params, $contribution, $input, $ids); - } - catch (Exception $e) { - throw new API_Exception('failed to load related objects' . $e->getMessage() . "\n" . $e->getTraceAsString()); + if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) { + throw new API_Exception('failed to load related objects'); } + + unset($contribution->id, $contribution->receive_date, $contribution->invoice_id); + $contribution->receive_date = $params['receive_date']; + + $passThroughParams = [ + 'trxn_id', + 'total_amount', + 'campaign_id', + 'fee_amount', + 'financial_type_id', + 'contribution_status_id', + 'membership_id', + 'payment_processor_id', + ]; + $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL)); + + return _ipn_process_transaction($params, $contribution, $input, $ids); } /** -- 2.25.1