import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.RegistrationManager;
import org.asamk.signal.manager.api.IncorrectPinException;
+import org.asamk.signal.manager.api.PinLockMissingException;
import org.asamk.signal.manager.api.PinLockedException;
import org.asamk.signal.output.JsonWriter;
import org.slf4j.Logger;
@Override
public void handleCommand(
- final VerifyParams request, final RegistrationManager m, final JsonWriter jsonWriter
+ final VerifyParams request,
+ final RegistrationManager m,
+ final JsonWriter jsonWriter
) throws CommandException {
verify(m, request.verificationCode(), request.pin());
}
private void verify(
- final RegistrationManager m, final String verificationCode, final String pin
+ final RegistrationManager m,
+ final String verificationCode,
+ final String pin
) throws UserErrorException, IOErrorException {
try {
m.verifyAccount(verificationCode, pin);
+ "\nUse '--pin PIN_CODE' to specify the registration lock PIN");
} catch (IncorrectPinException e) {
throw new UserErrorException("Verification failed! Invalid pin, tries remaining: " + e.getTriesRemaining());
+ } catch (PinLockMissingException e) {
+ throw new UserErrorException("Account is pin locked, but pin data has been deleted on the server.");
} catch (IOException e) {
throw new IOErrorException("Verify error: " + e.getMessage(), e);
}