android - Throw exception only for last item in RxJava chain -


i have list of wifi adresses in android app. also, there wifimanager accept address , connect if possible. connection procedure rxjava completable, throws exception in case of connection failure. how can check adresses 1 1, , throw exception if last adress failed?

just suppress errors in last completable

list<string> addresses = ... int s = address.size();  flowable.range(0, s) .flatmapcompletable(index -> {     completable c = manager.checkaddress(addresses.get(index));     if (index != s - 1) {         c = c.onerrorcomplete();     }     return c; }, false, 1) .subscribe(...) 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -