Surround ical parsing with try/catch to catch unknown bugs

This commit is contained in:
rejas 2020-11-24 21:32:16 +01:00
parent 6c3100e250
commit ccf98c0c22

View File

@ -76,7 +76,16 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
return;
}
const data = ical.parseICS(requestData);
let data = [];
try {
data = ical.parseICS(requestData);
} catch (error) {
fetchFailedCallback(self, error.message);
scheduleTimer();
return;
}
const newEvents = [];
// limitFunction doesn't do much limiting, see comment re: the dates array in rrule section below as to why we need to do the filtering ourselves