In some cases the start callbacks were not invoked when exception is thrown during HTTP call.
After this fix all waiting callbacks will be invoked on a failure.
Two unit tests are added to verify that the callbacks are invoked on failure - one is for common exception from HTTP framework (this includes the SSL handshake exception), second is when response code is 500 (internal server error).
Background
In some cases the start callbacks were not invoked when exception is thrown during HTTP call. After this fix all waiting callbacks will be invoked on a failure.
Two unit tests are added to verify that the callbacks are invoked on failure - one is for common exception from HTTP framework (this includes the SSL handshake exception), second is when response code is 500 (internal server error).