Coverage Summary for Class: TwitchApiException (io.github.captnblubber.twitchkt.error)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| TwitchApiException |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(9/9)
|
| TwitchApiException$BadRequest |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| TwitchApiException$Conflict |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| TwitchApiException$EmptyResponse |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(12/12)
|
| TwitchApiException$Forbidden |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| TwitchApiException$MissingScope |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(25/25)
|
| TwitchApiException$NotFound |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| TwitchApiException$RateLimited |
100%
(1/1)
|
|
100%
(4/4)
|
100%
(15/15)
|
| TwitchApiException$ServerError |
100%
(1/1)
|
|
100%
(4/4)
|
100%
(15/15)
|
| TwitchApiException$Unauthorized |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| TwitchApiException$UnprocessableEntity |
100%
(1/1)
|
|
100%
(3/3)
|
100%
(10/10)
|
| Total |
100%
(11/11)
|
|
100%
(35/35)
|
100%
(136/136)
|
package io.github.captnblubber.twitchkt.error
import io.github.captnblubber.twitchkt.auth.TwitchScope
sealed class TwitchApiException(
override val message: String,
cause: Throwable? = null,
) : Exception(message, cause) {
class Unauthorized(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class Forbidden(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class NotFound(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class BadRequest(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class RateLimited(
val retryAfterMs: Long,
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class Conflict(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class UnprocessableEntity(
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class ServerError(
val statusCode: Int,
override val message: String,
cause: Throwable? = null,
) : TwitchApiException(message, cause)
class MissingScope(
val missingScopes: List<TwitchScope>,
) : TwitchApiException(
"Missing required scope(s): ${missingScopes.joinToString { it.value }}",
)
class EmptyResponse(
val endpoint: String,
) : TwitchApiException(
"Twitch API returned an empty data array for endpoint: $endpoint",
)
}