checkChannel() provides a better error message in case you are not using Remoting mode.

This commit is contained in:
Jesse Glick committed 2017-04-07 12:04:58 -04:00
1 parent 98f227c20a
commit 45092f06a8
1 file changed
+2 -2
@@ -69,12 +69,12 @@ public abstract class AbstractPasswordBasedSecurityRealm extends SecurityRealm i
if (passwordFile!=null)
try {
password = new FilePath(command.channel,passwordFile).readToString().trim();
password = new FilePath(command.checkChannel(), passwordFile).readToString().trim();
} catch (IOException e) {
throw new BadCredentialsException("Failed to read "+passwordFile,e);
}
if (password==null)
password = command.channel.call(new InteractivelyAskForPassword());
password = command.checkChannel().call(new InteractivelyAskForPassword());
if (password==null)
throw new BadCredentialsException("No password specified");