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;
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) {
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) {