GAS-ICS-Sync
GAS-ICS-Sync copied to clipboard
Discussion: Notifications for failing sync
Happy to think about creating a PR request. But just wanted thoughts on this.
Thinking about the main issues that can occur
- Incorrect ics URLs which currently just produce a log message "[ERROR] Incorrect ics/ical URL: https://xxxxx"
- Syntax errors - although I think exceptions would already be produced for this via ics.js
- Calendar not found - right now seems to be creating a calendar when not found. Not sure if that's a great idea. Anyway, have not tested if there is an issue with permissions
The problem with these errors is that they can occur long after initial testing to make sure it's working. The main thing to achieve is dependability on your sync'd calendar and avoiding the possibility of a change outside of the script causing silent failures over a number of days going undetected resulting in real world missed appointments.
The features I think that would be helpful are: If there is a syntax error in one calendar, the syncing of other calendars should be able to continue. Incorrect ics URLs (and other errors that are currently just logged) should throw a proper error to make use of Google's failure notification system
One way to do this is to catch, log and store all errors as we go along, let things progress but throw an exception at the end with all the logged errors so the App Engine is aware of the failure.
I'm not sure if there is another way to mark the execution as failed but to let the script continue.