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

Comments

Your Answer

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.