1
0
Fork 0

catch error while trying to write to calendars file

This commit is contained in:
Ryan Mwangi 2024-10-20 01:29:38 +03:00
parent 7dfa5875fe
commit e5202791ac
1 changed files with 6 additions and 2 deletions

View File

@ -136,8 +136,12 @@ function saveCalendarData(calendarId, linkGroupName, calendars) {
linkGroupName: linkGroupName,
calendars: calendars
});
fs.writeFileSync(CALENDARS_FILE, JSON.stringify(calendarsData, null, 2));
try {
fs.writeFileSync(CALENDARS_FILE, JSON.stringify(calendarsData, null, 2));
} catch (error) {
console.error('Error writing to calendars file:', error);
}
}
// Function to update the merged calendar