The case of 502 errors (returning some html sometimes, like when behind a cloudflare proxy) is not handled properly. 