SteamKit
SteamKit copied to clipboard
Parse response body when Web API returns an error?
A previous release made it possible to find the status code when Web API returns an error (#517). I would now like to be able to parse the response body of the request when an error occurs.
It turns out Steam sometimes returns the same status code for different kinds of errors. The response body will contain a distinct message, though. For example, when calling ISteamUserStats/GetPlayerAchievements
, Steam could respond with a 403 (Forbidden), which either means that the request was rate-limited, or it could mean that the player has a private profile. When the latter occurs, the response body looks like this:
{
"playerstats": {
"error": "Profile is not public",
"success": false
}
}
Can WebAPIRequestException
or SteamKitWebRequestException
be extended to include a KeyValue
property for the response body?