import java.util.regex.Pattern;
import com.vaadin.server.AbstractUIProvider;
+import com.vaadin.server.DefaultErrorListener;
import com.vaadin.server.Terminal.ErrorEvent;
import com.vaadin.server.Terminal.ErrorListener;
import com.vaadin.server.VaadinSession;
}
@Override
- public String getTheme(WrappedRequest request,
- Class<? extends UI> uiClass) {
+ public String getTheme(WrappedRequest request, Class<? extends UI> uiClass) {
return theme;
}
@Override
public void terminalError(ErrorEvent event) {
- VaadinSession.getCurrent().getErrorHandler().terminalError(event);
+ DefaultErrorListener.doDefault(event);
}
public VaadinSession getContext() {
public class DefaultErrorListener implements Terminal.ErrorListener {
@Override
public void terminalError(ErrorEvent event) {
+ doDefault(event);
+ }
+
+ public static void doDefault(ErrorEvent event) {
final Throwable t = event.getThrowable();
if (t instanceof SocketException) {
// Most likely client browser closed socket
- getLogger()
- .info("SocketException in CommunicationManager."
+ getLogger().info(
+ "SocketException in CommunicationManager."
+ " Most likely client (browser) closed socket.");
return;
}
// Shows the error in AbstractComponent
if (owner instanceof AbstractComponent) {
- ((AbstractComponent) owner)
- .setComponentError(AbstractErrorMessage
- .getErrorMessageForException(t));
+ ((AbstractComponent) owner).setComponentError(AbstractErrorMessage
+ .getErrorMessageForException(t));
}
// also print the error on console
getLogger().log(Level.SEVERE, "Terminal error:", t);
}
- private Logger getLogger() {
+ private static Logger getLogger() {
return Logger.getLogger(DefaultErrorListener.class.getName());
}
}
\ No newline at end of file