Skip to content

Commit

Permalink
feat: show the exact error message instead of fixed one
Browse files Browse the repository at this point in the history
  • Loading branch information
phrshteh committed Jul 2, 2024
1 parent 616ffe4 commit 2a7c55a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Drivers/FarazSms/FarazSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function sendTemplate(string $phoneNumber, $template, array $options = []

if (empty($responseJson['data']['message_id'])) {
throw new SendingSmsFailedException(
'sent sms details not found in response',
$this->getStatusMessage($responseJson['status']),
$responseJson['status'],
);
}
Expand All @@ -72,7 +72,7 @@ public function sendBulk(array $phoneNumbers, string $message, array $options =

if (empty($responseJson['data']['message_id'])) {
throw new SendingSmsFailedException(
'sent sms details not found in response',
$this->getStatusMessage($responseJson['status']),
$responseJson['status'],
);
}
Expand All @@ -97,10 +97,6 @@ public function getBulkSmsUrl(): string

protected function mergeSmsOptions(array $data, array $options): array
{
if (empty($options)) {
return $data;
}

if (!isset($options['sender'])) {
throw new InvalidParameterException('sender parameter is required.');
}
Expand Down

0 comments on commit 2a7c55a

Please sign in to comment.