diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java index 0c8d024f1a..3f4ca616d0 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java @@ -24,11 +24,18 @@ import com.google.inject.Provider; import org.eclipse.jgit.lib.Config; import org.kohsuke.args4j.Argument; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; public class LfsPluginAuthCommand extends SshCommand { + private static final Logger log = + LoggerFactory.getLogger(LfsPluginAuthCommand.class); + private static final String CONFIGURATION_ERROR = "Server configuration error:" + + " LFS auth over SSH is not properly configured."; + public interface LfsSshPluginAuth { String authenticate(CurrentUser user, List args) throws UnloggedFailure, Failure; @@ -65,11 +72,11 @@ public class LfsPluginAuthCommand extends SshCommand { } @Override - protected void run() throws UnloggedFailure, Failure, Exception { + protected void run() throws UnloggedFailure, Exception { LfsSshPluginAuth pluginAuth = auth.get(); if (pluginAuth == null) { - throw new Failure(1, "Server configuration error:" - + " LFS auth over SSH is not properly configured."); + log.warn(CONFIGURATION_ERROR); + throw new UnloggedFailure(1, CONFIGURATION_ERROR); } stdout.print(pluginAuth.authenticate(user.get(), args));