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); }
@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); } }); }
@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); } }); }
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; }
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(); }
@Override public void onFailure(Throwable exception) { if(exception instanceof InvocationException) { ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getConstantValue( LocaleCommonConstants.SERVER_DISCONNECTED), true); } else { customFailure(exception); } }
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); } }
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(); }
protected static boolean isInvalidXSRF(Throwable caught) { return caught instanceof InvocationException && caught.getMessage().equals(JsonConstants.ERROR_INVALID_XSRF); }