public class RemovePinCommand implements JsonRpcLocalCommand {
- public RemovePinCommand(final OutputWriter outputWriter) {
+ @Override
+ public String getName() {
+ return "removePin";
}
- public static void attachToSubparser(final Subparser subparser) {
+ @Override
+ public void attachToSubparser(final Subparser subparser) {
subparser.help("Remove the registration lock pin.");
}
@Override
- public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
+ public void handleCommand(
+ final Namespace ns, final Manager m, final OutputWriter outputWriter
+ ) throws CommandException {
try {
m.setRegistrationLockPin(Optional.absent());
} catch (UnauthenticatedResponseException e) {
- throw new UnexpectedErrorException("Remove pin failed with unauthenticated response: " + e.getMessage());
+ throw new UnexpectedErrorException("Remove pin failed with unauthenticated response: " + e.getMessage(), e);
} catch (IOException e) {
- throw new IOErrorException("Remove pin error: " + e.getMessage());
+ throw new IOErrorException("Remove pin error: " + e.getMessage(), e);
}
}
}