Skip to content

Commit 1e35752

Browse files
committed
fix: use function in BBBClient
1 parent 7eb4ebe commit 1e35752

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/dev/imanity/bbbapi/BBBClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ class BBBClient(val token: Token) : Closeable {
9898
suspend inline fun <reified T : Any> decodeResponse(response: HttpResponse): Response<T> {
9999
val body = response.body<ResponseBody<T>>()
100100
return if (response.headers.contains("Retry-After")) {
101-
Response(response.headers["Retry-After"]!!.toLong())
101+
Response.rateLimit(response.headers["Retry-After"]!!.toLong())
102102
} else if (body.result == "error") {
103-
Response(body.error!!)
103+
Response.error(body.error!!)
104104
} else {
105-
Response(body.data!!)
105+
Response.success(body.data!!)
106106
}
107107
}

0 commit comments

Comments
 (0)