Nexmo/nexmo-laravel

How to make Nexmo to throw errors in Json

Closed this issue · 1 comments

I am trying to find a way of using Nexmo in a Laravel setup to throw errors in json so that they can be easily handled by my rest client but with no success so far.

mheap commented

Hi @eddywm,

nexmo/laravel isn't concerned with output formats, only with returning data/errors. To return JSON errors, you need to catch the exception thrown by Nexmo and return json($e->getMessage());