1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

NPE in GithubApi.

This commit is contained in:
Cedric Beust 2016-01-30 23:21:12 +04:00
parent f21efb6510
commit dac01c371a

View file

@ -137,8 +137,15 @@ public class GithubApi @Inject constructor(val executors: KobaltExecutors,
}
} catch(e: RetrofitError) {
val error = parseRetrofitError(e)
throw KobaltException("Couldn't retrieve releases, ${error.message ?: e}: "
+ error.errors[0].code + " field: " + error.errors[0].field)
val details = if (error.errors != null) {
error.errors[0]
} else {
null
}
// TODO: If the credentials didn't work ("bad credentials"), should start again
// using cbeust/kobalt, like above. Right now, just bailing.
log(2, "Couldn't retrieve releases from github, ${error.message ?: e}: "
+ details?.code + " field: " + details?.field)
}
result
}