Http error handling

This pull request is backward compatible and allows the user to keep control and handle the error thrown by request.