HTML response with 502 error from API end-point

Yes, nothing is guaranteed at 100%, but we can change this simple response. I’m discussing this subject, this change, and I’m tired to repeat.

One more time: is it mentioned somewhere in Twitch API documentation?

No, I should not. API have to response with JSON when it declares that it responses with JSON every time when it can. I’m not discussing internet connection issues or something like this, but if an API server can response with HTML — it can response with JSON. So, let’s change it.

I see another information here:

And this is not “a feature”, this is the error (or “bug”, if you wish).

Yes, it doesn’t, but I’m tired to repeat, I’m not about some theoretical error, OK? I’m about specific error. JSON for 502 response instead of HTML. That’s it. It’s simple. I hope you know understand me.

I want to resolve any error properly, in the most correct way. If there is an authentication error — I’ll handle it in my application and refresh tokens. If there is an internet connection issue — I’ll discuss it with my hosting/provider. If there is an HTML response from JSON API — I’ll enforce to change it on API server side.

I’m surprised how well you see the future. I don’t want to argue with 3rd party devs. I didn’t call them. But if they (you) come and try to convince me that I should change my code instead of correct fix on server side — I’ll argue with this. I don’t see correct arguments, only some theoretical issues and non-100% connections and uptime. But I don’t care about this, I’m here discussing one specific problem, error.