Skip to content

Commit

Permalink
Fix response handling for errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Nicholson committed Feb 18, 2021
1 parent 8f0127e commit f0146b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ClickatellClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public function send($to, $message)
*/
protected function handleProviderResponses(array $responses)
{
collect($responses)->each(function (stdClass $response) {
$errorCode = (int) $response->errorCode;
collect($responses['messages'])->each(function ($response) {
$errorCode = (int) $response['errorCode'];

if ($errorCode != self::SUCCESSFUL_SEND) {
throw CouldNotSendNotification::serviceRespondedWithAnError(
(string) $response->error,
$response['error'],
$errorCode
);
}
Expand Down

0 comments on commit f0146b7

Please sign in to comment.