You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a HTTP_CLIENT class which is pretty thing - allows me to accept parameters and call the HTTPful library while doing some logging before and after the call, it's functions just return the raw response from \Httpful\Request::post and \Httpful\Request::get. It all works fine as long as the API I am calling is up, however if it has fallen over the below seems to happen.
Results in an exception being thrown of type Httpful\Exception\ConnectionErrorException which I can catch no problem, but my issues comes when trying to return a useful value to the calling code.
I would like to be able to log the error and return a \Httpful\Response with a 500 error to the calling code. Is there an easy way to either just create a response object myself and return that, or in the POST and GET calls, have it not throw an exception but return the \Httpful\Response object (probably more elegant).
I've tried to create the \Httpful\Response object myself but can't seem to get it to construct.
The text was updated successfully, but these errors were encountered:
I have a HTTP_CLIENT class which is pretty thing - allows me to accept parameters and call the HTTPful library while doing some logging before and after the call, it's functions just return the raw response from \Httpful\Request::post and \Httpful\Request::get. It all works fine as long as the API I am calling is up, however if it has fallen over the below seems to happen.
Results in an exception being thrown of type Httpful\Exception\ConnectionErrorException which I can catch no problem, but my issues comes when trying to return a useful value to the calling code.
I would like to be able to log the error and return a \Httpful\Response with a 500 error to the calling code. Is there an easy way to either just create a response object myself and return that, or in the POST and GET calls, have it not throw an exception but return the \Httpful\Response object (probably more elegant).
I've tried to create the \Httpful\Response object myself but can't seem to get it to construct.
The text was updated successfully, but these errors were encountered: