We're updating the issue view to help you get more done. 

Catch exception from overlapping RRule and return bad request

Steps to reproduce

With scheduling data with a very long duration (>24 hours) such that events overlap, like this:

{"agent_id":"devca","duration":262500000,"end":"2019-07-30T12:55:00Z","inputs":["default"],"rrule":"FREQ=WEEKLY;BYDAY=MO,TU,TH,FR;BYHOUR=12;BYMINUTE=0","start":"2019-07-24T12:00:00Z"}

you get an exception thrown and an uninformative 500 internal server error from the POST /api/event endpoint:

2019-05-20T16:08:08,098 | ERROR | (EventsEndpoint:534) - Unable to create event
org.opencastproject.scheduler.api.SchedulerException: RRULE periods overlap
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.findConflictingEvents(SchedulerServiceImpl.java:1127) ~[?:?]
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEventInternal(SchedulerServiceImpl.java:541) ~[?:?]
at org.opencastproject.scheduler.impl.SchedulerServiceImpl.addMultipleEvents(SchedulerServiceImpl.java:492) ~[?:?]
at org.opencastproject.index.service.impl.IndexServiceImpl.createEvent(IndexServiceImpl.java:976) ~[?:?]
at org.opencastproject.external.endpoint.EventsEndpoint.scheduleNewEvent(EventsEndpoint.java:548) ~[101:opencast-external-api:7.0.0.SNAPSHOT]
at org.opencastproject.external.endpoint.EventsEndpoint.createNewEvent(EventsEndpoint.java:513) [101:opencast-external-api:7.0.0.SNAPSHOT]

This exception should get mapped to a bad request.

Status

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Components

Fix versions

Affects versions

6.0

Priority

Major