Show better error message when signal-cli version is outdated

This commit is contained in:
AsamK 2022-10-06 17:52:06 +02:00
parent d9472ec19c
commit 76c400d2c3
2 changed files with 8 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import org.asamk.signal.manager.util.KeyUtils;
import org.signal.libsignal.protocol.util.KeyHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
import java.io.File;
import java.io.IOException;
@ -114,6 +115,9 @@ public class SignalAccountFiles {
try {
manager.checkAccountState();
} catch (DeprecatedVersionException e) {
manager.close();
throw new AccountCheckException("signal-cli version is too old for the Signal-Server, please update.");
} catch (IOException e) {
manager.close();
throw new AccountCheckException("Error while checking account " + number + ": " + e.getMessage(), e);

View file

@ -18,6 +18,7 @@ import org.whispersystems.signalservice.api.push.ACI;
import org.whispersystems.signalservice.api.push.PNI;
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity;
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
import org.whispersystems.signalservice.api.util.DeviceNameUtil;
import org.whispersystems.signalservice.internal.push.OutgoingPushMessage;
@ -73,6 +74,9 @@ public class AccountHelper {
&& account.getRegistrationLockPin() != null) {
migrateRegistrationPin();
}
} catch (DeprecatedVersionException e) {
logger.debug("Signal-Server returned deprecated version exception", e);
throw e;
} catch (AuthorizationFailedException e) {
account.setRegistered(false);
throw e;