- public int handleCommand(final Namespace ns, final Manager m) {
- if (!m.isRegistered()) {
- System.err.println("User is not registered.");
- return 1;
+ public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
+ final var writer = new PlainTextWriterImpl(System.out);
+
+ final GroupId groupId;
+ try {
+ groupId = Util.decodeGroupId(ns.getString("group"));
+ } catch (GroupIdFormatException e) {
+ throw new UserErrorException("Invalid group id:" + e.getMessage());