mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 16:59:11 +07:00
Show text for json parse errors from github search
This commit is contained in:
@ -212,7 +212,12 @@ object Github {
|
||||
retries++ // An extra retry so the 403 is ignored in the retry count
|
||||
}
|
||||
} ?: continue
|
||||
return json().fromJson(GithubAPI.RepoSearch::class.java, inputStream.bufferedReader().readText())
|
||||
val text = inputStream.bufferedReader().readText()
|
||||
try {
|
||||
return json().fromJson(GithubAPI.RepoSearch::class.java, text)
|
||||
} catch (_: Throwable) {
|
||||
throw Exception("Failed to parse Github response as json - $text")
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
Reference in New Issue
Block a user