mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Print better error message for captcha required error
This commit is contained in:
parent
efa1c43b0b
commit
9546a79308
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,7 @@ import net.sourceforge.argparse4j.inf.Namespace;
|
||||||
import net.sourceforge.argparse4j.inf.Subparser;
|
import net.sourceforge.argparse4j.inf.Subparser;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
|
import org.whispersystems.signalservice.api.push.exceptions.CaptchaRequiredException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -22,6 +23,9 @@ public class RegisterCommand implements LocalCommand {
|
||||||
try {
|
try {
|
||||||
m.register(ns.getBoolean("voice"));
|
m.register(ns.getBoolean("voice"));
|
||||||
return 0;
|
return 0;
|
||||||
|
} catch (CaptchaRequiredException e) {
|
||||||
|
System.err.println("Captcha required for verification (" + e.getMessage() + ")");
|
||||||
|
return 1;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("Request verify error: " + e.getMessage());
|
System.err.println("Request verify error: " + e.getMessage());
|
||||||
return 3;
|
return 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue