providing error callback in http client