Skip to content

Commit

Permalink
fixed getThetaLicense error for V.
Browse files Browse the repository at this point in the history
  • Loading branch information
LassicYM authored Aug 6, 2024
1 parent f60e3d9 commit b4fcb62
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,19 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config?
if (response.status != HttpStatusCode.OK) {
throw ThetaWebApiException(response.toString())
}
return response.bodyAsText()
val input = response.body<ByteReadPacket>()
val builder = StringBuilder()
try {
while (!input.endOfInput) {
val char = input.readText(1, 1)
builder.append(char)
}
} catch (e: Throwable) {
throw e
} finally {
input.close()
}
return builder.toString()
} catch (e: JsonConvertException) {
throw ThetaWebApiException(e.message ?: e.toString())
} catch (e: ResponseException) {
Expand Down

0 comments on commit b4fcb62

Please sign in to comment.