本文整理汇总了Java中com.google.gwt.user.client.rpc.InvocationException类的典型用法代码示例。如果您正苦于以下问题:Java InvocationException类的具体用法?Java InvocationException怎么用?Java InvocationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvocationException类属于com.google.gwt.user.client.rpc包,在下文中一共展示了InvocationException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reportError
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
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);
}
示例2: listPuzzles
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
@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);
}
});
}
示例3: findPuzzle
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
@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);
}
});
}
示例4: getMessage
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
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;
}
示例5: onFailure
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
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();
}
示例6: onFailure
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
@Override
public void onFailure(Throwable exception) {
if(exception instanceof InvocationException) {
ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getConstantValue(
LocaleCommonConstants.SERVER_DISCONNECTED), true);
} else {
customFailure(exception);
}
}
示例7: handleFailure
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
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);
}
}
示例8: failed
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
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();
}
示例9: isInvalidXSRF
import com.google.gwt.user.client.rpc.InvocationException; //导入依赖的package包/类
protected static boolean isInvalidXSRF(Throwable caught) {
return caught instanceof InvocationException
&& caught.getMessage().equals(JsonConstants.ERROR_INVALID_XSRF);
}