Lately, we have noticed that some errors returned by the API do not follow the same format.
In these new errors, the API returns HTML instead of the error object that it usually returns in response. For example, when there is a 502 error creating an item or when the budget is exceeded.
Here is an example of 502 error:
Error: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
We think that this type of error should be encapsulated like the rest of the API responses