我有这个表达式
的lambda表达式institutionUserConnectionService.getActiveInstitutionUserConnectionsByUser(u)
抛出BusinessWxception
。是否有可能处理此异常?
users.parallelStream()
.forEach(u -> institutionUserConnections
.addAll(institutionUserConnectionService
.getActiveInstitutionUserConnectionsByUser(u)));
答案 0 :(得分:1)
不确定
users.parallelStream()
.forEach(u -> {
try {
institutionUserConnections.addAll(
institutionUserConnectionService.getActiveInstitutionUserConnectionsByUser(u)));
}
catch (BusinessWxception e) {
// decide what to do here
}
});