File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ class EventsFactory extends Factory {
556556 * If one of the ids are invalid (originalEvent or repetition not found) return null
557557 */
558558 if ( ! originalEvent || ! repetition ) {
559- return null ;
559+ throw new Error ( `Cant find event repetition for repetitionId: ${ repetitionId } and originalEventId: ${ originalEventId } ` ) ;
560560 }
561561
562562 return this . _composeEventWithRepetition ( originalEvent , repetition ) ;
@@ -610,7 +610,7 @@ class EventsFactory extends Factory {
610610 const event = await this . findById ( eventId ) ;
611611
612612 if ( ! event ) {
613- return null ;
613+ throw new Error ( `Event not found for eventId: ${ eventId } ` ) ;
614614 }
615615
616616 return this . getCollection ( this . TYPES . EVENTS )
@@ -634,7 +634,7 @@ class EventsFactory extends Factory {
634634 const event = await this . findById ( eventId ) ;
635635
636636 if ( ! event ) {
637- return null ;
637+ throw new Error ( `Event not found for eventId: ${ eventId } ` ) ;
638638 }
639639
640640 const query = { _id : new ObjectID ( event . _id ) } ;
@@ -692,7 +692,7 @@ class EventsFactory extends Factory {
692692 const event = await this . findById ( eventId ) ;
693693
694694 if ( ! event ) {
695- return null ;
695+ throw new Error ( `Event not found for eventId: ${ eventId } ` ) ;
696696 }
697697
698698 const query = { _id : new ObjectID ( event . _id ) } ;
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ type Event {
243243 timestamp: Float!
244244
245245 """
246- First appearance timestamp
246+ First occurrence timestamp
247247 """
248248 originalTimestamp: Float!
249249
You can’t perform that action at this time.
0 commit comments