From b97d677e3e7438dfa4ecfd66911d4796ecacc5d2 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 9 Oct 2017 18:37:48 +0100 Subject: Spot errors coming back when sending text. --- t/Mock/Twilio.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/Mock') diff --git a/t/Mock/Twilio.pm b/t/Mock/Twilio.pm index eaad30b76..125daa55f 100644 --- a/t/Mock/Twilio.pm +++ b/t/Mock/Twilio.pm @@ -20,6 +20,10 @@ sub dispatch_request { sub (POST + /2010-04-01/Accounts/*/Messages.json + %*) { my ($self, $sid, $data) = @_; + if ($data->{To} eq '+18165550101') { + return [ 400, [ 'Content-Type' => 'application/json' ], + [ '{"code":"21408", "message": "Unable to send"}' ] ]; + } push @{$self->texts}, $data; return [ 200, [ 'Content-Type' => 'application/json' ], [ '{}' ] ]; }, -- cgit v1.2.3