I have this lambda expression where this expression
institutionUserConnectionService.getActiveInstitutionUserConnectionsByUser(u)
throws a BusinessWxception. Is there any possibility to handle this exception?
users.parallelStream()
.forEach(u -> institutionUserConnections
.addAll(institutionUserConnectionService
.getActiveInstitutionUserConnectionsByUser(u)));
-
2Can you format your question?Amit– Amit2016年08月22日 19:27:40 +00:00Commented Aug 22, 2016 at 19:27
1 Answer 1
Sure:
users.parallelStream()
.forEach(u -> {
try {
institutionUserConnections.addAll(
institutionUserConnectionService.getActiveInstitutionUserConnectionsByUser(u)));
}
catch (BusinessWxception e) {
// decide what to do here
}
});
answered Aug 22, 2016 at 19:33
JB Nizet
694k94 gold badges1.3k silver badges1.3k bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java