mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -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 {
|
fun parseResponse(r: Response) : JCenterResponse {
|
||||||
val networkResponse = r.networkResponse()
|
val networkResponse = r.networkResponse()
|
||||||
if (networkResponse.code() != 200) {
|
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 {
|
} else {
|
||||||
return JCenterResponse(JsonParser().parse(r.body().string()).asJsonObject, null)
|
return JCenterResponse(JsonParser().parse(r.body().string()).asJsonObject, null)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue