Examples of UncaughtExceptionHandler


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

      return onFormSubmitImpl();
    }
  }

  public void onFrameLoad() {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
      onFrameLoadAndCatch(handler);
    } else {
      onFrameLoadImpl();
    }
View Full Code Here

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

   * handler.  Otherwise, run the Runnable and do not catch exceptions.
   *
   * @param runnable The Runnable to execute.
   */
  public static void runProtected(Runnable runnable) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
      try {
        runnable.run();
      } catch (Throwable e) {
        handler.onUncaughtException(e);
      }
    } else {
      runnable.run();
    }
  }
View Full Code Here

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

      if (LogLevel.showDebug()) {
        editMain.add(error);
        editMain.add(fatal);
        editMain.add(log);
        // We need our own uncaught exception hander to make sure the error shout happens
        GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
          public void onUncaughtException(Throwable e) {
            logUncaughtExceptions(e);
          }
        });
      } else {
        HTML spacer = new HTML();
        editMain.add(spacer);
      }

      initWidget(editMain);

      // Enable logging (important to do this after main is attached
      // such that exceptions occurring before this can be handled by
      // GWT's Default handler...)
      if (LogLevel.showDebug()) {
        DomLogger.enable(log.getElement());
        lottaLogging();
      }

      KeyBindingRegistry keysRegistry = new KeyBindingRegistry();
      extendKeyBindings(keysRegistry);

      // Start editing
      editor1.init(testEditorRegistries, keysRegistry, EditorSettings.DEFAULT);
      editor2.init(testEditorRegistries, keysRegistry, EditorSettings.DEFAULT);
      editor1.addUpdateListener(new EditorUpdateListener() {
        @Override
        public void onUpdate(EditorUpdateEvent event) {
          outputBothEditorStates();
        }

      });

      editor1.setOutputSink(editor1Sink);
      editor2.setOutputSink(editor2Sink);
      clearEditors();
      editor1.setEditing(true);
      editor2.setEditing(false);
      toggleEditCheck2.setValue(false);
      toggleEditCheck1.setValue(true);

      // Output initial state
      outputBothEditorStates();
      outputOperation(null);

    } catch (RuntimeException r) {
      // Do we need this at all?

      UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
      if (handler != null) {
        handler.onUncaughtException(r);
      } else {
        logger.error().log(r);
      }
      throw r;
    }
View Full Code Here

Examples of com.nilhcem.fakesmtp.core.exception.UncaughtExceptionHandler

      } catch (Exception e) {
        LOGGER.error("Failed to auto-start server in background", e);
      }
    } else {
            System.setProperty("mail.mime.decodetext.strict", "false");
            Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());

            EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
          try {
View Full Code Here

Examples of com.sun.jna.Callback.UncaughtExceptionHandler

    // exceptions.
    public void testCallbackExceptionHandler() {
        final RuntimeException ERROR = new RuntimeException(getName());
        final Throwable CAUGHT[] = { null };
        final Callback CALLBACK[] = { null };
        UncaughtExceptionHandler old = Native.getCallbackExceptionHandler();
        UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
            public void uncaughtException(Callback cb, Throwable e) {
                CALLBACK[0] = cb;
                CAUGHT[0] = e;
            }
        };
View Full Code Here

Examples of com.sun.jna.Callback.UncaughtExceptionHandler

    // CallbackProxy is called directly from native.
    public void testCallbackExceptionHandlerWithCallbackProxy() throws Throwable {
        final RuntimeException ERROR = new RuntimeException(getName());
        final Throwable CAUGHT[] = { null };
        final Callback CALLBACK[] = { null };
        UncaughtExceptionHandler old = Native.getCallbackExceptionHandler();
        UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
            public void uncaughtException(Callback cb, Throwable e) {
                CALLBACK[0] = cb;
                CAUGHT[0] = e;
            }
        };
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

  private static ThreadFactory build(ThreadFactoryBuilder builder) {
    final String nameFormat = builder.nameFormat;
    final Boolean daemon = builder.daemon;
    final Integer priority = builder.priority;
    final UncaughtExceptionHandler uncaughtExceptionHandler =
        builder.uncaughtExceptionHandler;
    final ThreadFactory backingThreadFactory =
        (builder.backingThreadFactory != null)
        ? builder.backingThreadFactory
        : Executors.defaultThreadFactory();
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

      super(server, bulkPlan, am);
    }

    @Override
    protected UncaughtExceptionHandler getUncaughtExceptionHandler() {
      return new UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable e) {
          LOG.warn("Assigning regions in " + t.getName(), e);
        }
      };
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

   * keeps its own internal stop mechanism so needs to be stopped by this
   * hosting server. Worker logs the exception and exits.
   */
  private void startServiceThreads() throws IOException {
    String n = Thread.currentThread().getName();
    UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        abort("Uncaught exception in service thread " + t.getName(), e);
      }
    };

View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

            if (System.getProperty("org.apache.commons.logging.Log") == null) { // $NON-NLS-1$
                System.setProperty("org.apache.commons.logging.Log" // $NON-NLS-1$
                        , "org.apache.commons.logging.impl.LogKitLogger"); // $NON-NLS-1$
            }

            Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {               
                public void uncaughtException(Thread t, Throwable e) {
                    if (!(e instanceof ThreadDeath)) {
                        log.error("Uncaught exception: ", e);
                        System.err.println("Uncaught Exception " + e + ". See log file for details.");
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.