import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.google.gwt.event.shared.UmbrellaException;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Timer;
import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector;
-import com.vaadin.terminal.gwt.client.ui.VNotification;
public class ApplicationConfiguration implements EntryPoint {
* especially end user. It does not work tells just as much.
*/
VConsole.getImplementation().error(e);
-
- if (!GWT.isProdMode()) {
- e.printStackTrace();
- }
-
- try {
- VNotification.createNotification(
- VNotification.DELAY_FOREVER).show(
- getExceptionText(e), VNotification.CENTERED,
- "error");
- } catch (Exception e2) {
- // Just swallow this exception
- }
}
});
deferredWidgetLoader = new DeferredWidgetLoader();
}
- private static final String getExceptionText(Throwable e) {
- if (e instanceof UmbrellaException) {
- UmbrellaException ue = (UmbrellaException) e;
- String text = "";
- for (Throwable t : ue.getCauses()) {
- text += getExceptionText(t) + "<br />";
- }
- return text;
- } else {
- String text = e.getClass().getName();
- String message = e.getMessage();
- if (message != null) {
- text += ": " + message;
- }
- return text;
- }
- }
-
/**
* Registers that callback that the bootstrap javascript uses to start
* applications once the widgetset is loaded and all required information is
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ui.RootConnector;
import com.vaadin.terminal.gwt.client.ui.VLazyExecutor;
+import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VOverlay;
import com.vaadin.terminal.gwt.client.ui.VWindow;
}
return;
}
- error(Util.getSimpleName(e) + ": " + e.getMessage());
+ String exceptionText = Util.getSimpleName(e);
+ String message = e.getMessage();
+ if (message != null && message.length() != 0) {
+ exceptionText += ": " + e.getMessage();
+ }
+ error(exceptionText);
GWT.log(e.getMessage(), e);
if (!GWT.isProdMode()) {
e.printStackTrace();
}
-
+ try {
+ VNotification.createNotification(VNotification.DELAY_FOREVER).show(
+ "<h1>Uncaught client side exception</h1><br />"
+ + exceptionText, VNotification.CENTERED, "error");
+ } catch (Exception e2) {
+ // Just swallow this exception
+ }
}
public void init() {