if (isNotSignedIn(caught) || isInvalidXSRF(caught)) {
new NotSignedInDialog().center();
} else if (isNoSuchEntity(caught)) {
if (Gerrit.isSignedIn()) {
new ErrorDialog(Gerrit.C.notFoundBody()).center();
} else {
new NotSignedInDialog().center();
}
} else if (isInactiveAccount(caught)) {
new ErrorDialog(Gerrit.C.inactiveAccountBody()).center();
} else if (isNoSuchAccount(caught)) {
final String msg = caught.getMessage();
final String who = msg.substring(NoSuchAccountException.MESSAGE.length());
final ErrorDialog d = new ErrorDialog(Gerrit.M.noSuchAccountMessage(who));
d.setText(Gerrit.C.noSuchAccountTitle());
d.center();
} else if (isNameAlreadyUsed(caught)) {
new ErrorDialog(Gerrit.C.nameAlreadyUsedBody()).center();
} else if (isNoSuchGroup(caught)) {
final String msg = caught.getMessage();
final String group = msg.substring(NoSuchGroupException.MESSAGE.length());
final ErrorDialog d = new ErrorDialog(Gerrit.M.noSuchGroupMessage(group));
d.setText(Gerrit.C.noSuchGroupTitle());
d.center();
} else if (caught instanceof ServerUnavailableException) {
new ErrorDialog(RpcConstants.C.errorServerUnavailable()).center();
} else {
GWT.log(getClass().getName() + " caught " + caught, caught);
new ErrorDialog(caught).center();
}
}