I use twilio in my laravel 5 application. To use it within the framework, I use the aloha/laravel-twilio .
Sending a valid test-credentials request works fine. I have problems when I want to implement error handling .
For some reason, the catch does not receive an error, which causes the application to crash. The error seems to be in twilio-sdk if I read the error message correctly.
Here is what I have done so far:
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Aloha\Twilio\TwilioInterface; class Activation extends Model { protected $fillable = array( 'a', 'b', 'c'); public static function send() {
This results in the following error:
Whoops, looks like something went wrong. Services_Twilio_RestException in /path/to/my/laravel/vendor/twilio/sdk/Services/Twilio.php line 297 Exception_message: The 'To' number +15005550001 is not a valid phone number.
This error should be selected from the documentation (not a valid phone number), but I should be able to catch and process it. This is currently not working. I am not getting an error ...
How to get twilio errors received and processed?
php try-catch laravel-5 twilio twilio-php
jerik Aug 16 '15 at 10:53 on 2015-08-16 10:53
source share