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

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

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

GWT.reportUncaughtException介绍

[英]Reports an exception caught at the "top level" to a handler set via #setUncaughtExceptionHandler(UncaughtExceptionHandler). This is used in places where the browser calls into user code such as event callbacks, timers, and RPC.

If no UncaughtExceptionHandler is set, the exception is reported to browser. Browsers usually log these exceptions to the JavaScript console.
[中]通过#setUncaughtExceptionHandler(UncaughtExceptionHandler)向处理程序集报告在“顶层”捕获的异常。这用于浏览器调用用户代码的地方,如事件回调、计时器和RPC。
如果未设置UncaughtExceptionHandler,则会将异常报告给浏览器。浏览器通常将这些异常记录到JavaScript控制台。

代码示例

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

/**
 * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler,
 * then removes all commands.
 *
 * <p>After this method completes, {@link #getScheduledCommands} returns only the commands
 * that have been scheduled by the initial commands.
 *
 * @return whether new commands have been scheduled after the execution
 */
public boolean executeScheduledCommands() {
 List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands);
 scheduledCommands.clear();
 for (ScheduledCommand command : commands) {
  try {
   command.execute();
  } catch (Throwable e) {
   GWT.reportUncaughtException(e);
  }
 }
 return !scheduledCommands.isEmpty();
}

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

/**
 * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands
 * newly scheduled by the initial commands. Removes the commands that returned {@code false}.
 *
 * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands
 * that are still scheduled.
 *
 * @return whether some commands are still scheduled (returned {@code true}) or
 *   new commands have been scheduled after the execution
 */
public boolean executeRepeatingCommands() {
 List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands);
 repeatingCommands.clear();
 for (RepeatingCommand command : commands) {
  boolean reschedule;
  try {
   reschedule = command.execute();
  } catch (Throwable e) {
   reschedule = false;
   GWT.reportUncaughtException(e);
  }
  if (reschedule) {
   repeatingCommands.add(command);
  }
 }
 return !repeatingCommands.isEmpty();
}

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

/**
 * Handles StorageEvents if a {@link StorageEvent.Handler} is registered.
 */
protected static final void handleStorageEvent(StorageEvent event) {
 if (!hasStorageEventHandlers()) {
  return;
 }
 for (StorageEvent.Handler handler : storageEventHandlers) {
  try {
   handler.onStorageChange(event);
  } catch (Throwable t) {
   GWT.reportUncaughtException(t);
  }
 }
}

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

private void onLoadImpl(int fragment) {
 fragmentHasLoaded(fragment);
 Object[] callbacks = allCallbacks[fragment];
 if (callbacks != null) {
  logEventProgress("runCallbacks" + fragment, "begin");
  allCallbacks[fragment] = null;
  for (Object callback : callbacks) {
   try {
    ((RunAsyncCallback) callback).onSuccess();
   } catch (Throwable t) {
    GWT.reportUncaughtException(t);
   }
  }
  logEventProgress("runCallbacks" + fragment, "end");
 }
}

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

GWT.reportUncaughtException(e);

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

/**
 * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler,
 * then removes all commands.
 *
 * <p>After this method completes, {@link #getScheduledCommands} returns only the commands
 * that have been scheduled by the initial commands.
 *
 * @return whether new commands have been scheduled after the execution
 */
public boolean executeScheduledCommands() {
 List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands);
 scheduledCommands.clear();
 for (ScheduledCommand command : commands) {
  try {
   command.execute();
  } catch (Throwable e) {
   GWT.reportUncaughtException(e);
  }
 }
 return !scheduledCommands.isEmpty();
}

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

/**
 * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler,
 * then removes all commands.
 *
 * <p>After this method completes, {@link #getScheduledCommands} returns only the commands
 * that have been scheduled by the initial commands.
 *
 * @return whether new commands have been scheduled after the execution
 */
public boolean executeScheduledCommands() {
 List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands);
 scheduledCommands.clear();
 for (ScheduledCommand command : commands) {
  try {
   command.execute();
  } catch (Throwable e) {
   GWT.reportUncaughtException(e);
  }
 }
 return !scheduledCommands.isEmpty();
}

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

/**
 * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands
 * newly scheduled by the initial commands. Removes the commands that returned {@code false}.
 *
 * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands
 * that are still scheduled.
 *
 * @return whether some commands are still scheduled (returned {@code true}) or
 *   new commands have been scheduled after the execution
 */
public boolean executeRepeatingCommands() {
 List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands);
 repeatingCommands.clear();
 for (RepeatingCommand command : commands) {
  boolean reschedule;
  try {
   reschedule = command.execute();
  } catch (Throwable e) {
   reschedule = false;
   GWT.reportUncaughtException(e);
  }
  if (reschedule) {
   repeatingCommands.add(command);
  }
 }
 return !repeatingCommands.isEmpty();
}

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

/**
 * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands
 * newly scheduled by the initial commands. Removes the commands that returned {@code false}.
 *
 * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands
 * that are still scheduled.
 *
 * @return whether some commands are still scheduled (returned {@code true}) or
 *   new commands have been scheduled after the execution
 */
public boolean executeRepeatingCommands() {
 List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands);
 repeatingCommands.clear();
 for (RepeatingCommand command : commands) {
  boolean reschedule;
  try {
   reschedule = command.execute();
  } catch (Throwable e) {
   reschedule = false;
   GWT.reportUncaughtException(e);
  }
  if (reschedule) {
   repeatingCommands.add(command);
  }
 }
 return !repeatingCommands.isEmpty();
}

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

/**
 * Handles StorageEvents if a {@link StorageEvent.Handler} is registered.
 */
protected static final void handleStorageEvent(StorageEvent event) {
 if (!hasStorageEventHandlers()) {
  return;
 }
 for (StorageEvent.Handler handler : storageEventHandlers) {
  try {
   handler.onStorageChange(event);
  } catch (Throwable t) {
   GWT.reportUncaughtException(t);
  }
 }
}

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

/**
 * Handles StorageEvents if a {@link StorageEvent.Handler} is registered.
 */
protected static final void handleStorageEvent(StorageEvent event) {
 if (!hasStorageEventHandlers()) {
  return;
 }
 for (StorageEvent.Handler handler : storageEventHandlers) {
  try {
   handler.onStorageChange(event);
  } catch (Throwable t) {
   GWT.reportUncaughtException(t);
  }
 }
}

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

@Override
  public void onFailure(Throwable caught) {
    if (caught instanceof StatusCodeException) {
      GWT.reportUncaughtException(caught);
    } else {
      for (Request request : this.requests) {
        if (request.param.getCallbacks().isEmpty()) {
          GWT.reportUncaughtException(caught);
        }
        for (AsyncCallback requestCallback : request.param.getCallbacks()) {
          requestCallback.onFailure(caught);
        }
      }
      if (this.callback != null) {
        this.callback.onFailure(caught);
      }
    }
  }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

@Override
  public void onFailure(Throwable caught) {
    if (caught instanceof StatusCodeException) {
      GWT.reportUncaughtException(caught);
    } else {
      for (Request request : this.requests) {
        if (request.param.getCallbacks().isEmpty()) {
          GWT.reportUncaughtException(caught);
        }
        for (AsyncCallback requestCallback : request.param.getCallbacks()) {
          requestCallback.onFailure(caught);
        }
      }
      if (this.callback != null) {
        this.callback.onFailure(caught);
      }
    }
  }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

@Override
  public void onFailure(Method method, Throwable exception) {
    fireResponseEvent(method);
    boolean caught = false;
    for (MethodCallback<T> methodCallback : callbackList) {
      try {
        methodCallback.onFailure(method, exception);
        caught = true;
      } catch (RuntimeException e) {
        // Exception not handled.
        continue;
      }
    }
    if (!caught) {
      GWT.reportUncaughtException(exception);
    }
  }
}

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

private void onLoadImpl(int fragment) {
 fragmentHasLoaded(fragment);
 Object[] callbacks = allCallbacks[fragment];
 if (callbacks != null) {
  logEventProgress("runCallbacks" + fragment, "begin");
  allCallbacks[fragment] = null;
  for (Object callback : callbacks) {
   try {
    ((RunAsyncCallback) callback).onSuccess();
   } catch (Throwable t) {
    GWT.reportUncaughtException(t);
   }
  }
  logEventProgress("runCallbacks" + fragment, "end");
 }
}

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

private void onLoadImpl(int fragment) {
 fragmentHasLoaded(fragment);
 Object[] callbacks = allCallbacks[fragment];
 if (callbacks != null) {
  logEventProgress("runCallbacks" + fragment, "begin");
  allCallbacks[fragment] = null;
  for (Object callback : callbacks) {
   try {
    ((RunAsyncCallback) callback).onSuccess();
   } catch (Throwable t) {
    GWT.reportUncaughtException(t);
   }
  }
  logEventProgress("runCallbacks" + fragment, "end");
 }
}

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

GWT.reportUncaughtException(e);

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

GWT.reportUncaughtException(e);

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

GWT.reportUncaughtException(e);

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

GWT.reportUncaughtException(response.getThrown());

相关文章