]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/VerifyCommand.java
Add new dbus message received signals with extendable extras map
[signal-cli] / src / main / java / org / asamk / signal / commands / VerifyCommand.java
index f32139bdccde69b8695db0fa0559b90ea86efdd3..b7fffcd23ca5c663c2abb2247c2652121483ad78 100644 (file)
@@ -3,7 +3,6 @@ package org.asamk.signal.commands;
 import net.sourceforge.argparse4j.inf.Namespace;
 import net.sourceforge.argparse4j.inf.Subparser;
 
-import org.asamk.signal.OutputWriter;
 import org.asamk.signal.commands.exceptions.CommandException;
 import org.asamk.signal.commands.exceptions.IOErrorException;
 import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
@@ -17,10 +16,13 @@ import java.io.IOException;
 
 public class VerifyCommand implements RegistrationCommand {
 
-    public VerifyCommand(final OutputWriter outputWriter) {
+    @Override
+    public String getName() {
+        return "verify";
     }
 
-    public static void attachToSubparser(final Subparser subparser) {
+    @Override
+    public void attachToSubparser(final Subparser subparser) {
         subparser.help("Verify the number using the code received via SMS or voice.");
         subparser.addArgument("verificationCode").help("The verification code you received via sms or voice call.");
         subparser.addArgument("-p", "--pin").help("The registration lock PIN, that was set by the user (Optional)");
@@ -42,9 +44,9 @@ public class VerifyCommand implements RegistrationCommand {
         } catch (KeyBackupServicePinException e) {
             throw new UserErrorException("Verification failed! Invalid pin, tries remaining: " + e.getTriesRemaining());
         } catch (KeyBackupSystemNoDataException e) {
-            throw new UnexpectedErrorException("Verification failed! No KBS data.");
+            throw new UnexpectedErrorException("Verification failed! No KBS data.", e);
         } catch (IOException e) {
-            throw new IOErrorException("Verify error: " + e.getMessage());
+            throw new IOErrorException("Verify error: " + e.getMessage(), e);
         }
     }
 }