Add UnregisteredRecipientException

This commit is contained in:
AsamK 2021-12-30 17:15:40 +01:00
parent a7ecb9e10f
commit c88c92086e
20 changed files with 244 additions and 117 deletions

View file

@ -8,6 +8,7 @@ import org.asamk.signal.commands.exceptions.UnexpectedErrorException;
import org.asamk.signal.commands.exceptions.UserErrorException;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.NotMasterDeviceException;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.util.CommandUtil;
@ -44,6 +45,8 @@ public class BlockCommand implements JsonRpcLocalCommand {
throw new UserErrorException("This command doesn't work on linked devices.");
} catch (IOException e) {
throw new UnexpectedErrorException("Failed to sync block to linked devices: " + e.getMessage(), e);
} catch (UnregisteredRecipientException e) {
throw new UserErrorException("The user " + e.getSender().getIdentifier() + " is not registered.");
}
}