GAS-ICS-Sync
GAS-ICS-Sync copied to clipboard
Error, Retrying...Exception: Address unavailable
When running the startSync function, I get this error 3 times before everything in the target calendar is deleted.
Please recheck the correct format of your sourceCalendars variable, and make sure the url is reachable.
There also seems to be a similar issue on google's issuetracker for triggered runs.
The url is definitely reachable, if I enter it in my browser, I can download and view it with no problems.
I was experiencing this when my ical links were down.. Sometimes the url is unavailable and in those cases, I just wanted to skip the syncing so that not all the entries were deleted.
I changed the section of code to skip if calendars are not available. I realize this doesn't actually correspond to the reason this issue was opened... but perhaps there should be some option to prevent deletion in case the ics url is unavailable for whatever reason. The little snippet of code I added below solves the issue in my case. I was going to open a new issue and submit a feature request but I'm not sure if I should or if others have a better way to handle this..
//------------------------ Fetch URL items ------------------------
var responses = fetchSourceCalendars(sourceCalendarURLs);
//I added the next If block to handle cases when calendars are unavailable
if (responses.length == 0){
Logger.log("Skipping " + targetCalendarName);
continue;
}
Logger.log("Syncing " + responses.length + " calendars to " + targetCalendarName);
Duplicate of #343