1

Implemented Exeption and their handling

This commit is contained in:
Mahgs
2020-03-09 16:18:14 +01:00
parent 72c8d2b9b0
commit b30a4d02f9
7 changed files with 73 additions and 15 deletions

View File

@ -1,5 +1,6 @@
package mops.gruppen2.service;
import mops.gruppen2.domain.Exceptions.EventException;
import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.event.Event;
import org.springframework.stereotype.Service;
@ -19,7 +20,13 @@ public class GroupService {
Group buildGroupFromEvents(List<Event> eventList) {
Group newGroup = new Group();
eventList.forEach(newGroup::applyEvent);
try {
for (Event event : eventList) {
newGroup.applyEvent(event);
}
}catch (EventException e){
e.printStackTrace();
}
return newGroup;
}