diff options
author | Felype Santiago Ferreira <felype@vaadin.com> | 2013-10-08 16:04:32 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-10-15 13:06:39 +0000 |
commit | d461fb438f62b38d2082b41b0a3c7a1189927c3d (patch) | |
tree | 669ab05513c356a1ad784fafd496e47e9865d446 /server/src/com/vaadin/ui/UI.java | |
parent | 6a99730d898f8e0663d69dbeba6682113c29ca52 (diff) | |
download | vaadin-framework-d461fb438f62b38d2082b41b0a3c7a1189927c3d.tar.gz vaadin-framework-d461fb438f62b38d2082b41b0a3c7a1189927c3d.zip |
Fixed swallower access. Now error handler logs exceptions. (#12703)
Change-Id: If8fe00e10c7ec56cbd8753ff88d4816613a340f2
Diffstat (limited to 'server/src/com/vaadin/ui/UI.java')
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 27f04c39e1..746fa194ac 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -24,6 +24,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.concurrent.Future; +import java.util.logging.Level; import java.util.logging.Logger; import com.vaadin.event.Action; @@ -35,6 +36,9 @@ import com.vaadin.navigator.Navigator; import com.vaadin.server.ClientConnector; import com.vaadin.server.ComponentSizeValidator; import com.vaadin.server.ComponentSizeValidator.InvalidLayout; +import com.vaadin.server.DefaultErrorHandler; +import com.vaadin.server.ErrorHandler; +import com.vaadin.server.ErrorHandlingRunnable; import com.vaadin.server.LocaleService; import com.vaadin.server.Page; import com.vaadin.server.PaintException; @@ -1287,11 +1291,36 @@ public abstract class UI extends AbstractSingleComponentContainer implements throw new UIDetachedException(); } - return session.access(new Runnable() { + 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 + .findErrorHandler(UI.this); + + if (errorHandler == null) { + errorHandler = new DefaultErrorHandler(); + } + + errorHandler.error(errorEvent); + } + } catch (Exception e) { + getLogger().log(Level.SEVERE, e.getMessage(), e); + } + } }); } |