[#20] fixed exception handling

This commit is contained in:
B. Endres 2020-05-24 19:16:04 +02:00
commit 94df842477
3 changed files with 6 additions and 4 deletions

View file

@ -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());
}

View file

@ -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());
}

View file

@ -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());
}