mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Better error logging from JCenter.
This commit is contained in:
parent
ffb0397a3c
commit
658858e87e
1 changed files with 3 additions and 1 deletions
|
@ -36,7 +36,9 @@ open public class UnauthenticatedJCenterApi @Inject constructor(open val http: H
|
|||
fun parseResponse(r: Response) : JCenterResponse {
|
||||
val networkResponse = r.networkResponse()
|
||||
if (networkResponse.code() != 200) {
|
||||
return JCenterResponse(null, networkResponse.message())
|
||||
val message = networkResponse.message()
|
||||
val errorObject = JsonParser().parse(r.body().string()).asJsonObject
|
||||
return JCenterResponse(null, message + ": " + errorObject.get("message").asString)
|
||||
} else {
|
||||
return JCenterResponse(JsonParser().parse(r.body().string()).asJsonObject, null)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue