Skip to content

Instantly share code, notes, and snippets.

@benweidig
Created May 16, 2020 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benweidig/5db43a70374a8a13efd1cc6764affc2d to your computer and use it in GitHub Desktop.
Save benweidig/5db43a70374a8a13efd1cc6764affc2d to your computer and use it in GitHub Desktop.
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