Improve error message and return value. #658

This commit is contained in:
Korina Cordero 2022-04-12 09:59:35 +00:00
parent a6add363bd
commit 6fff162c0e

View file

@ -36,7 +36,9 @@ class RisingTideGateway
// at this point, assume that mobile is numeric and valid mobile number // at this point, assume that mobile is numeric and valid mobile number
$clean_num = $this->cleanPhoneNumber($mobile_num); $clean_num = $this->cleanPhoneNumber($mobile_num);
if ($clean_num != '') if ($clean_num == false)
error_log('Invalid mobile number provided. Cannot send SMS message to ' . $mobile_num);
else
{ {
$headers = [ $headers = [
'Content-Type: application/vnd.net.wyrls.Document-v3+json' 'Content-Type: application/vnd.net.wyrls.Document-v3+json'
@ -89,8 +91,6 @@ class RisingTideGateway
error_log($result); error_log($result);
} }
else
error_log('Invalid mobile number provided. Cannot send SMS message.');
} }
public function validatePhoneNumber($mobile) public function validatePhoneNumber($mobile)
@ -151,6 +151,6 @@ class RisingTideGateway
return $clean_number; return $clean_number;
} }
return ""; return false;
} }
} }