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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -