Given this java 8 code
public Server send(String message) {
sessions.parallelStream()
.map(Session::getBasicRemote)
.forEach(basic -> {
try {
basic.sendText(message);
} catch (IOException e) {
e.printStackTrace();
}
});
return this;
}
how do we properly make this IOException
be delegated up the stack of the method call? (in nutshell how to make this method throw this IOException
?)
Lambdas in java does not look very friendly to error handling...