0

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)));
xenteros
15.9k12 gold badges59 silver badges93 bronze badges
asked Aug 22, 2016 at 19:25
1
  • 2
    Can you format your question? Commented Aug 22, 2016 at 19:27

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.