X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/af4709255ab553419cc78863479894361151484b..56ee173d03baf8feede7c14aea5d9d670a047ae7:/src/main/java/org/asamk/signal/commands/RegisterCommand.java diff --git a/src/main/java/org/asamk/signal/commands/RegisterCommand.java b/src/main/java/org/asamk/signal/commands/RegisterCommand.java index 5018b7e0..1ca7bee2 100644 --- a/src/main/java/org/asamk/signal/commands/RegisterCommand.java +++ b/src/main/java/org/asamk/signal/commands/RegisterCommand.java @@ -9,6 +9,7 @@ import net.sourceforge.argparse4j.inf.Subparser; import org.asamk.signal.OutputType; import org.asamk.signal.commands.exceptions.CommandException; import org.asamk.signal.commands.exceptions.IOErrorException; +import org.asamk.signal.commands.exceptions.RateLimitErrorException; import org.asamk.signal.commands.exceptions.UserErrorException; import org.asamk.signal.manager.RegistrationManager; import org.asamk.signal.manager.api.CaptchaRequiredException; @@ -64,7 +65,7 @@ public class RegisterCommand implements RegistrationCommand, JsonRpcRegistration private void register( final RegistrationManager m, final boolean voiceVerification, final String captcha - ) throws UserErrorException, IOErrorException { + ) throws CommandException { try { m.register(voiceVerification, captcha); } catch (RateLimitException e) { @@ -72,7 +73,7 @@ public class RegisterCommand implements RegistrationCommand, JsonRpcRegistration if (e.getNextAttemptTimestamp() > 0) { message += "\nNext attempt may be tried at " + DateUtils.formatTimestamp(e.getNextAttemptTimestamp()); } - throw new UserErrorException(message); + throw new RateLimitErrorException(message, e); } catch (CaptchaRequiredException e) { String message; if (captcha == null) {