})));
}
}
public void onWebsocketError(Exception ex) {
GridPanel gp = getGridPanel();
String msg = ex.getMessage();
if (ex instanceof WebsocketNotConnectedException) {
if (game.isStarted()) {
msg = _("Connection lost") + " - save game and load on server side and then connect with client as workaround" ;
} else {
msg = _("Connection lost");
}
} else {
logger.error(ex.getMessage(), ex);
}
if (msg == null || msg.length() == 0) {
msg = ex.getClass().getSimpleName();
}
if (gp != null) {
gp.setErrorMessage(msg);
} else {
JOptionPane.showMessageDialog(client, msg, _("Error"), JOptionPane.ERROR_MESSAGE);
}
}