# HG changeset patch # User Matti Hamalainen # Date 1468301858 -10800 # Node ID 42b6acc5988ecb5304d22a90b4c509897a065486 # Parent c582522d2dcc2cbf4cf9667a2f13a941895eda4f Add some error handling. diff -r c582522d2dcc -r 42b6acc5988e multimerge.py --- a/multimerge.py Tue Jul 12 01:01:10 2016 +0300 +++ b/multimerge.py Tue Jul 12 08:37:38 2016 +0300 @@ -485,13 +485,16 @@ src_events = [] for calendar in src_calendars: gcm_debug(u"- "+calendar["id"]) - result = service.events().list( - timeZone="EEST", - calendarId=calendar["id"], - singleEvents=True, - showDeleted=False, -# orderBy="startTime", - ).execute() + try: + result = service.events().list( + timeZone="EEST", + calendarId=calendar["id"], + singleEvents=True, + showDeleted=False, +# orderBy="startTime", + ).execute() + except Exception as e: + gcm_fatal(u"Failed to fetch calendar events for {0}:\n\n{1}\n\nERROR: {2}\n".format(calendar["id"], calendar, str(e))) c_found = None if "colorId" in calendar and calendar["colorId"] in colors["calendar"]: