If we did not get back a JSON response, throw the original HTTP error.

Sometimes, on uncaught exceptions, or gateway timeouts, HTML is returned instead of JSON.