Don't log stacktrace if git over HTTP fails due to wrong password

It's a user error if a wrong password is provided and the Gerrit
administrator doesn't need a stacktrace for this.

Change-Id: Ie370440d8be52b4be4ea4f7d052c843a1e414708
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-06-05 11:13:32 +02:00
parent 61ff9a69ef
commit 3acdb3a837
3 changed files with 33 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.data.ParameterizedString;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.server.account.AccountException;
import com.google.gerrit.server.account.AuthenticationFailedException;
import com.google.gerrit.server.auth.NoSuchUserException;
import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig;
@@ -172,7 +173,7 @@ import javax.security.auth.login.LoginException;
try {
return new InitialDirContext(env);
} catch (NamingException e) {
throw new AccountException("Incorrect username or password", e);
throw new AuthenticationFailedException("Incorrect username or password", e);
}
}