use of org.rstudio.studio.client.application.events.InvalidClientVersionEvent in project rstudio by rstudio.
the class RemoteServer method handleRpcErrorInternally.
private boolean handleRpcErrorInternally(RpcError error) {
if (error.getCode() == RpcError.UNAUTHORIZED) {
handleUnauthorizedError();
return true;
} else if (error.getCode() == RpcError.INVALID_CLIENT_ID) {
// disconnect
disconnect();
// fire event
ClientDisconnectedEvent event = new ClientDisconnectedEvent();
eventBus_.fireEvent(event);
// handled
return true;
} else if (error.getCode() == RpcError.INVALID_CLIENT_VERSION) {
// disconnect
disconnect();
// fire event
InvalidClientVersionEvent event = new InvalidClientVersionEvent();
eventBus_.fireEvent(event);
// handled
return true;
} else if (error.getCode() == RpcError.SERVER_OFFLINE) {
// disconnect
disconnect();
// fire event
ServerOfflineEvent event = new ServerOfflineEvent();
eventBus_.fireEvent(event);
// handled
return true;
} else if (error.getCode() == RpcError.INVALID_SESSION) {
// disconnect
disconnect();
// fire event
InvalidSessionInfo info = error.getClientInfo().isObject().getJavaScriptObject().cast();
InvalidSessionEvent event = new InvalidSessionEvent(info);
eventBus_.fireEvent(event);
// handled
return true;
} else {
return false;
}
}
Aggregations