if (session == null) {
throw new UIDetachedException();
}
return session.access(new ErrorHandlingRunnable() {
@Override
public void run() {
accessSynchronously(runnable);
}
@Override
public void handleError(Exception exception) {
try {
if (runnable instanceof ErrorHandlingRunnable) {
ErrorHandlingRunnable errorHandlingRunnable = (ErrorHandlingRunnable) runnable;
errorHandlingRunnable.handleError(exception);
} else {
ConnectorErrorEvent errorEvent = new ConnectorErrorEvent(
UI.this, exception);
ErrorHandler errorHandler = com.vaadin.server.ErrorEvent