Java 类com.google.gwt.user.client.rpc.InvocationException 实例源码

项目:aggregate    文件:AggregateUI.java   
public void reportError(String context, Throwable t) {
  String textMessage;
  if (t instanceof org.opendatakit.common.persistence.client.exception.DatastoreFailureException) {
    textMessage = context + t.getMessage();
  } else if (t instanceof org.opendatakit.common.security.client.exception.AccessDeniedException) {
    textMessage = "You do not have permission for this action.\n" + context + t.getMessage();
  } else if (t instanceof InvocationException) {
    // could occur if the cached JavaScript is out-of-sync with server
    UrlHash.redirect();
    return;
  } else if ( t.getMessage().contains("uuid:081e8b57-1698-4bbf-ba5b-ae31338b121d") ) {
    // magic number for the service-error.html page.
    // Generally means an out-of-quota error.
    UrlHash.redirect();
    return;
  } else {
    textMessage = context + t.getMessage();
  }
  errorMsgLabel.setText(textMessage);
  displayErrorPanel();
  resize();
  Window.alert(textMessage);
}
项目:shortyz    文件:RetryLocalStorageServiceProxy.java   
@Override
public Request listPuzzles(final AsyncCallback<PuzzleDescriptor[]> callback) {
    return super.listPuzzles( new AsyncCallback<PuzzleDescriptor[]>(){

        @Override
        public void onFailure(Throwable caught) {
            if(caught instanceof InvocationException){
                RetryLocalStorageServiceProxy.super.listPuzzles(callback);
            } else {
                callback.onFailure(caught);
            }
        }

        @Override
        public void onSuccess(PuzzleDescriptor[] result) {
            callback.onSuccess(result);
        }

    });
}
项目:shortyz    文件:RetryLocalStorageServiceProxy.java   
@Override
public Request findPuzzle(final Long puzzleId, final AsyncCallback<Puzzle> callback) {
    return super.findPuzzle(puzzleId, new AsyncCallback<Puzzle>(){

        @Override
        public void onFailure(Throwable caught) {
            if(caught instanceof InvocationException ){
                RetryLocalStorageServiceProxy.super.findPuzzle(puzzleId, callback);
            } else {
                callback.onFailure(caught);
            }
        }

        @Override
        public void onSuccess(Puzzle result) {
            callback.onSuccess(result);
        }

    });
}
项目:qafe-platform    文件:ExceptionUtil.java   
public static String getMessage(Throwable caught, String message) {
    String messageBody = "";
    try {
        throw caught;
    } catch (IncompatibleRemoteServiceException incompatibleException) {
        messageBody = "This application is out of date, please click the refresh button on your browser.";
    } catch (InvocationException  invocationException) {

        messageBody =  "The network connection to the server is temporarily unavailable.Please retry or refresh the browser. If the problem still exists please contact your support team.";                        
    } catch (GWTApplicationStoreException  gwtApplicationStoreException) {

        messageBody =  "Please refresh the browser. If the problem still exists please contact your support team.";                     
    } 
    catch (Throwable te) {
        messageBody = message;      
    } 
    return messageBody;
}
项目:essence    文件:AsyncCallbackAdapter.java   
public void onFailure(Throwable caught) {

        if (caught instanceof InvocationException) {
            InvocationException ie = (InvocationException) caught;
            if(ie.getMessage().contains("j_spring_security_check"))
            {
//                Window.alert("Session is timed out. Please login again");
                Window.open(GWT.getHostPageBaseURL() + "login.html", "_self", null);
                return;
            }
        } 

      //Do other error handling here
        doFailureAction();
    }
项目:ephesoft    文件:EphesoftAsyncCallback.java   
@Override
public void onFailure(Throwable exception) {
    if(exception instanceof InvocationException) {
        ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getConstantValue(
                LocaleCommonConstants.SERVER_DISCONNECTED), true);
    } else {
        customFailure(exception);
    }

}
项目:wannatrak    文件:ServerRequest.java   
protected void handleFailure(Throwable caught) {
    if (caught instanceof InvocationException || caught instanceof IncompatibleRemoteServiceException) {
        if (caught instanceof StatusCodeException) {
            handleStatusCodeException(caught);
        } else {
            handleUncheckedException(caught);
        }
    } else if (caught instanceof CheckedException) {
        handleCheckedException((CheckedException) caught);
    } else {
        handleUnknownException(caught);
    }
}
项目:Peergos    文件:DynaTableWidget.java   
public void failed(Throwable caught) {
  setStatusText("Error");
  if (errorDialog == null) {
    errorDialog = new ErrorDialog();
  }
  if (caught instanceof InvocationException) {
    errorDialog.setText("An RPC server could not be reached");
    errorDialog.setBody(NO_CONNECTION_MESSAGE);
  } else {
    errorDialog.setText("Unexcepted Error processing remote call");
    errorDialog.setBody(caught.getMessage());
  }
  errorDialog.center();
}
项目:swarm    文件:DynaTableWidget.java   
public void failed(Throwable caught) {
  setStatusText("Error");
  if (errorDialog == null) {
    errorDialog = new ErrorDialog();
  }
  if (caught instanceof InvocationException) {
    errorDialog.setText("An RPC server could not be reached");
    errorDialog.setBody(NO_CONNECTION_MESSAGE);
  } else {
    errorDialog.setText("Unexcepted Error processing remote call");
    errorDialog.setBody(caught.getMessage());
  }
  errorDialog.center();
}
项目:gerrit    文件:GerritCallback.java   
protected static boolean isInvalidXSRF(Throwable caught) {
  return caught instanceof InvocationException
      && caught.getMessage().equals(JsonConstants.ERROR_INVALID_XSRF);
}