com.google.gwt.core.client.GWT.UncaughtExceptionHandler Java Examples

The following examples show how to use com.google.gwt.core.client.GWT.UncaughtExceptionHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Console.java    From flow with Apache License 2.0 6 votes vote down vote up
private static void doReportStacktrace(Exception exception) {
    // Defer without $entry to bypass some of GWT's exception handling
    deferWithoutEntry(() -> {
        // Bypass regular exception reporting
        UncaughtExceptionHandler originalHandler = GWT
                .getUncaughtExceptionHandler();
        GWT.setUncaughtExceptionHandler(
                ignore -> GWT.setUncaughtExceptionHandler(originalHandler));

        // Throw in the appropriate way
        if (exception instanceof JavaScriptException) {
            // Throw originally thrown instance through JS
            jsThrow(((JavaScriptException) exception).getThrown());
        } else {
            throw exception;
        }
    });
}
 
Example #2
Source File: Client.java    From unitime with Apache License 2.0 5 votes vote down vote up
public void onModuleLoad() {
	GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
		@Override
		public void onUncaughtException(Throwable e) {
			Throwable u = ToolBox.unwrap(e);
			sLogger.log(Level.WARNING, MESSAGES.failedUncaughtException(u.getMessage()), u);
		}
	});
	Scheduler.get().scheduleDeferred(new ScheduledCommand() {
		@Override
		public void execute() {
			onModuleLoadDeferred();
		}
	});
}
 
Example #3
Source File: Application.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onModuleLoad() {
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
        public void onUncaughtException(Throwable e) {
            GWT.log("Uncaught Exception", e);
        }
    });
    
    // TODO refactor startup to be more explicit
    getPropertiesManager(); // creates singleton
}
 
Example #4
Source File: Login.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onModuleLoad() {
	if (RootPanel.get("loadingwrapper-login") == null)
		return;

	GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
		@Override
		public void onUncaughtException(Throwable caught) {
			SC.warn("Error", caught.getMessage());
		}

	});

	instance = this;

	declareShowLostDialog(this);

	// Tries to capture locale parameter
	final String lang = Util.detectLocale();
	I18N.setLocale(lang);

	// Tries to capture tenant parameter
	final String tenant = Util.detectTenant();

	// Get grid of scrollbars, and clear out the window's built-in margin,
	// because we want to take advantage of the entire client area.
	Window.enableScrolling(false);
	Window.setMargin("0px");

	InfoService.Instance.get().getInfo(I18N.getLocale(), tenant, true, new AsyncCallback<GUIInfo>() {
		@Override
		public void onFailure(Throwable error) {
			SC.warn(error.getMessage());
		}

		@Override
		public void onSuccess(final GUIInfo info) {
			CookiesManager.saveRelease(info);

			I18N.init(info);

			WindowUtils.setTitle(info, null);

			Feature.init(info);
			Session.get().setInfo(info);

			WindowUtils.setFavicon(info);

			if ("mobile".equals(Util.getJavascriptVariable("j_layout")))
				loginPanel = new MobileLoginPanel(info);
			else
				loginPanel = new LoginPanel(info);

			Login.this.showLogin();
		}

	});
}
 
Example #5
Source File: StageZero.java    From swellrt with Apache License 2.0 4 votes vote down vote up
/** @return the uncaught exception handler to install. */
protected UncaughtExceptionHandler createUncaughtExceptionHandler() {
  // Use GWT's one by default.
  return GWT.getUncaughtExceptionHandler();
}
 
Example #6
Source File: WebClient.java    From swellrt with Apache License 2.0 4 votes vote down vote up
private ErrorHandler(UncaughtExceptionHandler next) {
  this.next = next;
}
 
Example #7
Source File: StageZero.java    From swellrt with Apache License 2.0 4 votes vote down vote up
/** @return the uncaught exception handler to install. */
protected UncaughtExceptionHandler createUncaughtExceptionHandler() {
  // Use GWT's one by default.
  return GWT.getUncaughtExceptionHandler();
}
 
Example #8
Source File: WebClient.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
private ErrorHandler(UncaughtExceptionHandler next) {
  this.next = next;
}
 
Example #9
Source File: StageZero.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
/** @return the uncaught exception handler to install. */
protected UncaughtExceptionHandler createUncaughtExceptionHandler() {
  // Use GWT's one by default.
  return GWT.getUncaughtExceptionHandler();
}