mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
parent
e77d9e3d60
commit
189b21dbde
5 changed files with 40 additions and 4 deletions
|
@ -5,7 +5,9 @@ import net.sourceforge.argparse4j.inf.Subparser;
|
|||
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.CaptchaRejectedException;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -38,6 +40,9 @@ public class SubmitRateLimitChallengeCommand implements JsonRpcLocalCommand {
|
|||
m.submitRateLimitRecaptchaChallenge(challenge, captcha);
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Submit challenge error: " + e.getMessage(), e);
|
||||
} catch (CaptchaRejectedException e) {
|
||||
throw new UserErrorException(
|
||||
"Captcha rejected, it may be outdated, already used or solved from a different IP address.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.asamk.Signal;
|
|||
import org.asamk.signal.BaseConfig;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.AttachmentInvalidException;
|
||||
import org.asamk.signal.manager.api.CaptchaRejectedException;
|
||||
import org.asamk.signal.manager.api.DeviceLinkUrl;
|
||||
import org.asamk.signal.manager.api.GroupId;
|
||||
import org.asamk.signal.manager.api.GroupInviteLinkUrl;
|
||||
|
@ -159,8 +160,10 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
|
|||
m.submitRateLimitRecaptchaChallenge(challenge, captcha);
|
||||
} catch (IOException e) {
|
||||
throw new Error.Failure("Submit challenge error: " + e.getMessage());
|
||||
} catch (CaptchaRejectedException e) {
|
||||
throw new Error.Failure(
|
||||
"Captcha rejected, it may be outdated, already used or solved from a different IP address.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue