1

add error handling (frontend) + exception changes

Co-authored-by: Christoph <tobi@urpost.de>
Co-authored-by: Mahgs <maxoerter@gmx.de>
This commit is contained in:
Christoph
2020-03-18 16:26:11 +01:00
parent 0ade9319fb
commit df7803f83d
20 changed files with 140 additions and 86 deletions

View File

@ -27,11 +27,12 @@ public class AddUserEvent extends Event {
this.email = email;
}
public void apply(Group group) throws EventException{
@Override
public void applyEvent(Group group) throws EventException {
User user = new User(this.user_id, this.givenname, this.familyname, this.email);
if (group.getMembers().contains(user)){
throw new UserAlreadyExistsException("Der User existiert bereits");
if (group.getMembers().contains(user)) {
throw new UserAlreadyExistsException();
}
group.getMembers().add(user);