com.google.gwt.core.client.GWT.setUncaughtExceptionHandler()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中com.google.gwt.core.client.GWT.setUncaughtExceptionHandler()方法的一些代码示例,展示了GWT.setUncaughtExceptionHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.setUncaughtExceptionHandler()方法的具体详情如下:
包路径:com.google.gwt.core.client.GWT
类名称:GWT
方法名:setUncaughtExceptionHandler

GWT.setUncaughtExceptionHandler介绍

[英]Sets a custom uncaught exception handler. See #getUncaughtExceptionHandler() for details.
[中]设置自定义未捕获异常处理程序。有关详细信息,请参见#getUncaughtExceptionHandler()。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Called via reflection in Development Mode; do not ever call this method in
 * Production Mode.
 */
static void setBridge(GWTBridge bridge) {
 com.google.gwt.core.shared.GWT.setBridge(bridge);
 if (bridge != null) {
  setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

public void onModuleLoad() {
  impl.configureClientSideLogging();

  if (impl.loggingIsEnabled()) {
   if (GWT.getUncaughtExceptionHandler() == null) {
    final Logger log = Logger.getLogger(LogConfiguration.class.getName());
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
     public void onUncaughtException(Throwable e) {
      log.log(Level.SEVERE, e.getMessage(), e);
     }
    });
   }
  }
 }
}

代码示例来源:origin: org.kuali.student.core/ks-common-ui

public static void bindUncaughtExceptionHandler() {
  GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
    public void onUncaughtException(Throwable e) {
      GWT.log(e.getMessage(), e);
      //Window.alert("Uncaught exception was thrown:"+getStackTrace(e)+"\nMessage:"+e.getMessage());
      KSErrorDialog.show(e);
    }
  });
}

代码示例来源:origin: com.ahome-it/ahome-tooling-nativetools

public final Client setDefaultUncaughtExceptionHandler()
{
  GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler()
  {
    @Override
    public void onUncaughtException(final Throwable e)
    {
      error("Uncaught Exception:", e);
    }
  });
  return this;
}

代码示例来源:origin: fr.putnami.pwt/pwt

private DefaultErrorManager() {
  GWT.setUncaughtExceptionHandler(this);
}

代码示例来源:origin: thothbot/parallax

public static void setDefaultUncaughtExceptionHandler(final Thread.UncaughtExceptionHandler javaHandler) {
  GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
    @Override
    public void onUncaughtException (Throwable e) {
      final Thread th = new Thread() {
        @Override
        public String toString() {
          return "The only thread";
        }
      };
      javaHandler.uncaughtException(th, e);
    }
  });
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

@Override
public void onModuleLoad() 
{
  GWT.setUncaughtExceptionHandler(this);
  GWT.create(ClientContext.class);
}

代码示例来源:origin: com.allen-sauer.gwt.log/gwt-log

@Override
public final void setUncaughtExceptionHandler() {
 GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
  @Override
  public void onUncaughtException(Throwable e) {
   Log.fatal("Uncaught Exception:", e);
  }
 });
 setErrorHandler();
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Installs an {@link UncaughtExceptionHandler} that will automatically invoke
 * {@link #report(String, Throwable)}.
 *
 * @param url A URL that is suitable for use with {@code XMLHttpRequest}
 */
public static void installUncaughtExceptionHandler(String url) {
 GWT.setUncaughtExceptionHandler(new MyHandler(url));
}

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui

@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
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Called via reflection in Development Mode; do not ever call this method in
 * Production Mode.
 */
static void setBridge(GWTBridge bridge) {
 com.google.gwt.core.shared.GWT.setBridge(bridge);
 if (bridge != null) {
  setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
 }
}

代码示例来源:origin: errai/errai

private void setUncaughtExceptionHandler() {
 final UncaughtExceptionHandler replacedHandler = GWT.getUncaughtExceptionHandler();
 GWT.setUncaughtExceptionHandler(new ErraiUncaughtExceptionHandler(replacedHandler));
}

代码示例来源:origin: com.google.web.bindery/requestfactory-server

/**
 * Called via reflection in Development Mode; do not ever call this method in
 * Production Mode.
 */
static void setBridge(GWTBridge bridge) {
 com.google.gwt.core.shared.GWT.setBridge(bridge);
 if (bridge != null) {
  setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Called via reflection in Development Mode; do not ever call this method in
 * Production Mode.
 */
static void setBridge(GWTBridge bridge) {
 com.google.gwt.core.shared.GWT.setBridge(bridge);
 if (bridge != null) {
  setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler());
 }
}

代码示例来源:origin: com.googlecode.gwt-measure/gwt-measure

private void hookExceptionHandler() {
  GWT.UncaughtExceptionHandler exceptionHandler = GWT.getUncaughtExceptionHandler();
  GWT.setUncaughtExceptionHandler(new WrappingExceptionHandler(exceptionHandler));
}

代码示例来源:origin: net.wetheinter/gwt-user

public void onModuleLoad() {
  impl.configureClientSideLogging();

  if (impl.loggingIsEnabled()) {
   if (GWT.getUncaughtExceptionHandler() == null) {
    final Logger log = Logger.getLogger(LogConfiguration.class.getName());
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
     public void onUncaughtException(Throwable e) {
      log.log(Level.SEVERE, e.getMessage(), e);
     }
    });
   }
  }
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

public void onModuleLoad() {
  impl.configureClientSideLogging();

  if (impl.loggingIsEnabled()) {
   if (GWT.getUncaughtExceptionHandler() == null) {
    final Logger log = Logger.getLogger(LogConfiguration.class.getName());
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
     public void onUncaughtException(Throwable e) {
      log.log(Level.SEVERE, e.getMessage(), e);
     }
    });
   }
  }
 }
}

代码示例来源:origin: oVirt/ovirt-engine

void initUncaughtExceptionHandler() {
  // Prevent uncaught exceptions from escaping application code
  GWT.setUncaughtExceptionHandler(t -> {
    applicationLogManager.logUncaughtException(t);
    if (DisplayUncaughtUIExceptions.getValue()) {
      alertManager.showUncaughtExceptionAlert(t);
    }
  });
}

代码示例来源:origin: errai/errai

@Override
protected void gwtSetUp() throws Exception {
 testHandlerLog.clear();
 GWT.setUncaughtExceptionHandler(testHandler);
 super.gwtSetUp();
 uncaughtHandlersLogger = IOCUtil.getInstance(UncaughtExceptionTestLogger.class);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-management-web

public void onModuleLoad() {
    injector.getResources().css().ensureInjected();
    
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {

      public void onUncaughtException(@Nonnull final Throwable throwable) {
        ErrorDialog errorDialog = injector.getErrorDialog();
        errorDialog.setException(throwable);
        errorDialog.center();
      }
    });
    
    injector.getDispatcher().start();
  }
}

相关文章