Fix the error path when the HTTP server gives a non-200 response.