A way to deal with HTTP error responses