Handle UnauthenticatedResponseException internally

This commit is contained in:
AsamK 2021-10-31 20:53:03 +01:00
parent 782f96b580
commit 31dec5a666
7 changed files with 16 additions and 24 deletions

View file

@ -6,9 +6,7 @@ import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.OutputWriter;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.commands.exceptions.IOErrorException;
import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.manager.Manager;
import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException;
import java.io.IOException;
import java.util.Optional;
@ -31,8 +29,6 @@ public class RemovePinCommand implements JsonRpcLocalCommand {
) throws CommandException {
try {
m.setRegistrationLockPin(Optional.empty());
} catch (UnauthenticatedResponseException e) {
throw new UnexpectedErrorException("Remove pin failed with unauthenticated response: " + e.getMessage(), e);
} catch (IOException e) {
throw new IOErrorException("Remove pin error: " + e.getMessage(), e);
}