import org.asamk.signal.OutputWriter;
import org.asamk.signal.commands.exceptions.CommandException;
+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.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
+
public class BlockCommand implements JsonRpcLocalCommand {
private final static Logger logger = LoggerFactory.getLogger(BlockCommand.class);
m.setContactBlocked(contact, true);
} catch (NotMasterDeviceException e) {
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());
}
}
m.setGroupBlocked(groupId, true);
} catch (GroupNotFoundException e) {
logger.warn("Group not found {}: {}", groupId.toBase64(), e.getMessage());
+ } catch (IOException e) {
+ throw new UnexpectedErrorException("Failed to sync block to linked devices: " + e.getMessage());
}
}
}