One issue I'm having is that if a phone number has been unsubscribed, Twilio throws a \Twilio\Exceptions\RestException but in that exception there is no information about what the phone number was that caused the error. I'd like to unsubscribe that user when this happens because they have been unsubscribed (error code 21610).
The exception appears to be thrown at /twilio/src/Twilio.php:103 - would it be possible to discuss wrapping this line in a try/catch and firing custom exception that includes the data from the RestException but also includes the $to and $params values? I'm thinking something like this:
Thanks for this great package, I love using it.
One issue I'm having is that if a phone number has been unsubscribed, Twilio throws a
\Twilio\Exceptions\RestException
but in that exception there is no information about what the phone number was that caused the error. I'd like to unsubscribe that user when this happens because they have been unsubscribed (error code 21610).The exception appears to be thrown at
/twilio/src/Twilio.php:103
- would it be possible to discuss wrapping this line in a try/catch and firing custom exception that includes the data from theRestException
but also includes the$to
and$params
values? I'm thinking something like this:I'd be happy to put together a PR if this is something you'd be interested in including.