Package com.google.gwt.core.client.GWT

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


   * {@link UncaughtExceptionHandler} if one is currently set.
   */
  private static void invokeAndMaybeReportUncaughtExceptions(Callback callback) {
    assert (callback != null);

    UncaughtExceptionHandler ucHandler = GWT.getUncaughtExceptionHandler();
    if (ucHandler != null) {
      invokeAndReportUncaughtExceptions(callback, ucHandler);
    } else {
      invokeImpl(callback);
    }
View Full Code Here


    }

    JSOVoidCallback voidCb = new JSOVoidCallback() {
      @Override
      public void callback() {
        UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();

        if (handler != null) {
          fireLoadCbAndCatch(handler, url, cb);
        } else {
          fireLoadCb(url, cb);
        }
      }

      /**
       * Does the work of actual invoking the user's callback code.
       *
       * @param url the URL that was passed when the load was initiated.
       * @param cb the user callback to invoke.
       */
      private void fireLoadCb(String url, GeoXmlLoadCallback cb) {
        // TODO: If this.jsoPeer is null at this point, the outer load() call
        // may not yet have executed this.setJsoPeer(). Would adding a test
        // and subsequent DeferredCommand solve this?
       
        Throwable caught = null;
        GeoXmlOverlay overlay = null;
        try {
          if (GeoXmlOverlayImpl.impl.loadedCorrectly(storedJso)) {
            overlay = new GeoXmlOverlay(storedJso);
          }
        } catch (Throwable e) {
          caught = e;
        }

        if (caught == null && overlay != null) {
          cb.onSuccess(url, overlay);
        } else {
          cb.onFailure(url, caught);
        }
      }

      /**
       * Wraps firing the callback so that an exception handler can be called.
       *
       * @param handler the uncaught exception handler to call
       * @param url the url made in the load request
       * @param cb callback to use on success/failure.
       */
      private void fireLoadCbAndCatch(UncaughtExceptionHandler handler,
          String url, GeoXmlLoadCallback cb) {
        try {
          fireLoadCb(url, cb);
        } catch (Throwable e) {
          handler.onUncaughtException(e);
        }
      }
    };

    JavaScriptObject outerJsoPeer = GeoXmlOverlayImpl.impl.constructGeoXmlOverlay(
View Full Code Here

        callback.onCaptureSuccess(url, captureId);
      } else {
        callback.onCaptureFailure(url, captureId);
      }
    } catch (Throwable e) {
      UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
      if (ueh != null) {
        ueh.onUncaughtException(e);
      }
    }
  }
View Full Code Here

     */
    public void onModuleLoad() {

        // could use Log.setUncaughtExceptionHandler(), but we'd like the
        // stacktrace too.
        GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
            public void onUncaughtException(Throwable arg0) {
                arg0.printStackTrace();
                // gwt-log errors on null message;
                String message = arg0.getMessage() == null ? "No Message"
                        : arg0.getMessage();
View Full Code Here

                    .create(ErrorNotificationHandler.class);
            Logger.getLogger("").addHandler(errorNotificationHandler);
        }

        if (LogConfiguration.loggingIsEnabled()) {
            GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

                @Override
                public void onUncaughtException(Throwable e) {
                    /*
                     * If the debug window is not enabled (?debug), this will
View Full Code Here

  /**
   * This is the entry point method.
   */
  @Override
  public void onModuleLoad() {
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
      @Override
      public void onUncaughtException(Throwable e) {
        log.log(Level.SEVERE, e.getMessage(), e);
      }
    });
View Full Code Here

            }
          }
        }
      }
      } catch (Exception e) {
        UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
        if (handler != null) {
          e.printStackTrace();
          handler.onUncaughtException(e);
        }
      }
    }
  }.schedule(10);
  }
View Full Code Here

        /*
         * 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.
View Full Code Here

        /*
         * 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.
View Full Code Here

    }
    return valid;
  }

  public boolean onFormSubmit() {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
      return onFormSubmitAndCatch(handler);
    } else {
      return onFormSubmitImpl();
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.GWT.UncaughtExceptionHandler

Copyright © 2018 www.massapicom. 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.