Closed vados60 closed 6 years ago
You can put a try-catch
around this, as the adapter calls Deferred.completeExceptionally when the request fails.
try {
api.login(username, password).await()
} catch (e: IOException) {
// handle exception
}
@JakeWharton Please advise how am I supposed to handle Network exceptions when request fails? ex internet is unavailable?
In this case API call instead of Deferred<?> returns nothing and chain breaks here.
api.login(username, password).await()
-- somewhere inside execution fails and in Logcat I see <-- HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "URL HERE": No address associated with hostname`interface API {
}`