add exception
This commit is contained in:
@ -7,6 +7,7 @@ import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.Role;
|
||||
import mops.gruppen2.domain.User;
|
||||
import mops.gruppen2.domain.exception.EventException;
|
||||
import mops.gruppen2.domain.exception.GroupFullException;
|
||||
import mops.gruppen2.domain.exception.UserAlreadyExistsException;
|
||||
|
||||
/**
|
||||
@ -37,7 +38,7 @@ public class AddUserEvent extends Event {
|
||||
}
|
||||
//andere exception
|
||||
if (group.getMembers().size() == group.getUserMaximum()){
|
||||
throw new UserAlreadyExistsException(this.getClass().toString());
|
||||
throw new GroupFullException(this.getClass().toString());
|
||||
}
|
||||
|
||||
group.getMembers().add(user);
|
||||
|
||||
Reference in New Issue
Block a user