/** Abstract callback handling generic error conditions automatically */
public abstract class GerritCallback<T> implements AsyncCallback<T> {
public void onFailure(final Throwable caught) {
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)) {