From 1e88d3787947e6bba31982c379e55fdb003aa9bf Mon Sep 17 00:00:00 2001 From: alext Date: Fri, 23 Jun 2017 09:53:22 +0200 Subject: [PATCH] Suppress Google Syncing exception whenever a Google Calendar event is not found. --- src/application/libraries/Google_sync.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/application/libraries/Google_sync.php b/src/application/libraries/Google_sync.php index 04bb8152..5ee46b21 100644 --- a/src/application/libraries/Google_sync.php +++ b/src/application/libraries/Google_sync.php @@ -231,7 +231,11 @@ class Google_Sync { * be deleted. */ public function delete_appointment($provider, $google_event_id) { - $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); + try { + $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); + } catch (Exception $ex) { + // Event was not found on Google Calendar. + } } /** @@ -299,7 +303,11 @@ class Google_Sync { * @param string $google_event_id Google Calendar event id to be deleted. */ public function delete_unavailable($provider, $google_event_id) { - $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); + try { + $this->service->events->delete($provider['settings']['google_calendar'], $google_event_id); + } catch (Exception $ex) { + // Event was not found on Google Calendar. + } } /**