mapTwitchApiError
fun mapTwitchApiError(statusCode: Int, body: String, retryAfterMs: Long? = null): TwitchApiException
Maps an HTTP status code and response body to the appropriate TwitchApiException.
Parameters
statusCode
the HTTP status code from the Twitch API response.
body
the raw response body text.
retryAfterMs
for 429 responses, the number of milliseconds until the rate limit resets. Pass null when the retry-after information is not available.