Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#560 Replace instances of CRM_Core_Error::fatal with Exceptio… #15941

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

seamuslee001
Copy link
Contributor

…ns or Status bounces in SMS processing and appropriately handle error after

Overview

This replaces instances of CRM_Core_Error::fatal in the SMS subsystem with CRM_Core_Exceptions or CRM_Core_Error::statusBounce as appropriate and updates the relevant functions to handle the change in error handling

Before

Legacy function used

After

Modern functions used

ping @eileenmcnaughton @mattwire

@civibot
Copy link

civibot bot commented Nov 23, 2019

(Standard links)

@@ -113,8 +113,12 @@ public function setDefaultValues() {
$name = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, NULL);
if ($name) {
$defaults['name'] = $name;
$provider = CRM_SMS_Provider::singleton(['provider' => $name]);
$defaults['api_url'] = $provider->_apiURL;
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my hesitation is around this one & the next one which adds handling. The previous behaviour here was a fatal when the provider was invalid. Without the catch here the form layer would give the equivalent of that - but with the catch it seems an obscure edge case bug would be ignored

try {
$provider = CRM_SMS_Provider::singleton($_REQUEST);
}
catch (CRM_Core_exception $e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here - we are adding handling for what appears to be an obscure edge case bug where the no-change would be to leave it uncaught

…ns or Status bounces in SMS processing and appropriately handle error after
@seamuslee001
Copy link
Contributor Author

ok @eileenmcnaughton i have reverted the changes in those 2 places

@eileenmcnaughton
Copy link
Contributor

looks good now

@eileenmcnaughton eileenmcnaughton merged commit c6235d8 into civicrm:master Nov 25, 2019
@eileenmcnaughton eileenmcnaughton deleted the dev_core_560_sms branch November 25, 2019 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants