Created
May 16, 2020 16:49
-
-
Save benweidig/5db43a70374a8a13efd1cc6764affc2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void doWork(List<MyBean> beans) { | |
beans.stream() | |
.map(bean -> { | |
try { | |
// do some work that might throw | |
} | |
catch (ValidationException e) { | |
// handle appropriately | |
} | |
}) | |
.forEach(item -> { | |
try { | |
// more work that might throw | |
} | |
catch (IOException e) { | |
// handle appropriately | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment