Skip to content

Commit

Permalink
Show text for json parse errors from github search
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Jul 28, 2024
1 parent e42e327 commit 7c9aab5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/com/unciv/logic/github/Github.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7c9aab5

Please sign in to comment.