laravel-notification-channels / twilio

Twilio notifications channel for Laravel
https://laravel-notification-channels.com
227 stars 36 forks source link

[Request] For FailedNotification to have twilio exception error code #19

Closed jkatz50 closed 6 years ago

jkatz50 commented 7 years ago

Currently, only the error message is passed back when twilio fails to send. It would be cool to be able to get the twilio error code (or whole exception) for more consistent handling: https://www.twilio.com/docs/api/errors/reference

This is how the event is currently fired: https://github.com/laravel-notification-channels/twilio/blob/master/src/TwilioChannel.php#L58-L62

} catch (Exception $exception) {
    $this->events->fire(
        new NotificationFailed($notifiable, $notification, 'twilio', ['message' => $exception->getMessage()])
     );
}
gregoriohc commented 6 years ago

This has been added on release 2.0.2