From e2f7213697741fdd774e4f663722fba1776369ed Mon Sep 17 00:00:00 2001
From: Fabio Manganiello <blacklight86@gmail.com>
Date: Thu, 20 Dec 2018 16:47:07 +0100
Subject: [PATCH] Don't fail hard if it was not possible to get the ical
 content

---
 platypush/plugins/calendar/ical.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/platypush/plugins/calendar/ical.py b/platypush/plugins/calendar/ical.py
index a5c591b83..878324a11 100644
--- a/platypush/plugins/calendar/ical.py
+++ b/platypush/plugins/calendar/ical.py
@@ -69,10 +69,21 @@ class IcalCalendarPlugin(Plugin, CalendarInterface):
         """
 
         events = []
-        response = requests.get(self.url)
+        try:
+            response = requests.get(self.url)
+        except Exception as e:
+            self.logger.exception(e)
+            return events
 
         if response.ok:
-            calendar = Calendar.from_ical(response.text)
+            calendar = None
+
+            try:
+                calendar = Calendar.from_ical(response.text)
+            except Exception as e:
+                self.logger.exception(e)
+                return events
+
             for event in calendar.walk():
                 if event.name != 'VEVENT':
                     continue  # Not an event