mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-19 13:43:56 +00:00
fix: better error message
This commit is contained in:
@@ -38,6 +38,10 @@ object CommentsAPI {
|
||||
val request = requestBuilder()
|
||||
val json = request.get(url)
|
||||
if (!json.text.startsWith("{")) return null
|
||||
val res = json.code == 200
|
||||
if (!res) {
|
||||
errorReason(json.code, json.text)
|
||||
}
|
||||
val parsed = try {
|
||||
Json.decodeFromString<CommentResponse>(json.text)
|
||||
} catch (e: Exception) {
|
||||
|
||||
Reference in New Issue
Block a user