GWT.log(caught.toString(), caught);
try {
throw caught;
} catch (InvocationException invocationException) {
if(caught.getMessage().equals(SharedConstants.LOGGED_OUT)){
ConnectrApp.get().getEventBus().fireEvent(new LogoutEvent());
return;
}
if (retriesLeft <= 0) {
RPCCall.this.onFailure(invocationException);
} else {
call(retriesLeft - 1); // retry call
}
} catch (IncompatibleRemoteServiceException remoteServiceException) {
Window.alert("The app maybe out of date. Reload this page in your browser.");
} catch (SerializationException serializationException) {
Window.alert("A serialization error occurred. Try again.");
} catch (NotLoggedInException e) {
ConnectrApp.get().getEventBus().fireEvent(new LogoutEvent());
} catch (RequestTimeoutException e) {
Window.alert("This is taking too long, try again");
} catch (Throwable e) {// application exception
RPCCall.this.onFailure(e);
}