Browse Source

improved logging while setting up logging #5613

svn changeset:15082/svn branch:6.4
tags/6.7.0.beta1
Matti Tahvonen 13 years ago
parent
commit
e0d084bcdf
1 changed files with 15 additions and 9 deletions
  1. 15
    9
      src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java

+ 15
- 9
src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java View File

@@ -376,15 +376,6 @@ public class ApplicationConfiguration implements EntryPoint {
};

public void onModuleLoad() {
// display some sort of error of exceptions in web mode to debug console
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
Console console = VConsole.getImplementation();
if (console != null) {
console.error(e.getMessage());
} // else very early phase of init, alert ??
}
});

// Prepare VConsole for debugging
if (isDebugMode()) {
@@ -395,6 +386,21 @@ public class ApplicationConfiguration implements EntryPoint {
} else {
VConsole.setImplementation((Console) GWT.create(NullConsole.class));
}
/*
* Display some sort of error of exceptions in web mode to debug
* console. After this, exceptions are reported to VConsole and possible
* GWT hosted mode.
*/
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
/*
* Note in case of null console (without ?debug) we eat
* exceptions. "a1 is not an object" style errors helps nobody,
* especially end user. It does not work tells just as much.
*/
VConsole.getImplementation().error(e.getMessage());
}
});

initConfigurations();
startNextApplication();

Loading…
Cancel
Save