Maybe it should just do stderr -> ignore -> continue in stead of stopping on http error codes from Google?
A tip btw: Make the lastsync value calendar specific. I can see a number of situations where new calendars are added, deleted or changed or syncs fails and other reasons not to have a global lastsync value.