Example #1
0
  void throwError(String shortMsg, Throwable th, VoidDelegate<Throwable> errorHandler) {
    if (th == null) th = new JsException(shortMsg);

    if (errorHandler != null) {
      errorHandler.voidDelegate(th);
    } else {
      onError(th);
    }
  }
Example #2
0
  public Object call(
      String clazz,
      final String method,
      Object[] args,
      final VoidDelegate<Object> callBack,
      final VoidDelegate<Throwable> errorHandler)
      throws Throwable {
    if (errorHandler != null) errorHandler.voidDelegate(null);
    else onError(null);

    boolean async = callBack != null;
    if (!async || autoRequest) {
      List<AjaxRequest> requests = StrictWeb.jsNewList();
      requests.add(new AjaxRequest(clazz, method, args, callBack, errorHandler));
      return makeRequest(async, requests, errorHandler);
    } else {
      requestQueue.add(new AjaxRequest(clazz, method, args, callBack, errorHandler));
      return null;
    }
  }