In the event of a timeout or other non 200 http code response the request error will now be caught and formatted similarly to the response block ( { stat: 'OK', ...} ) and returned through the callback.
I have tested this code in our system and it does properly handle timeouts. A caught error will look like this:
{
stat: 'ERROR',
message: 'Some error message taken from the caught Error object'
}
In the event of a timeout or other non 200 http code response the request error will now be caught and formatted similarly to the response block (
{ stat: 'OK', ...}
) and returned through the callback.I have tested this code in our system and it does properly handle timeouts. A caught error will look like this:
This fix will take care of issue #19