From d4993b479adc77ca21ab924b2e5fdf35b5feabf9 Mon Sep 17 00:00:00 2001 From: kwinkunks Date: Sat, 21 Jun 2014 09:56:36 -0300 Subject: [PATCH] cope with uptime robot outage --- main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index a627c86..0f98369 100644 --- a/main.py +++ b/main.py @@ -698,8 +698,13 @@ def get(self): # Opened URLs are file-like. full_url = '{0}?{1}'.format(ur_url, ur_query) - f = urllib2.urlopen(full_url) - raw_json = f.read() + try: + f = urllib2.urlopen(full_url) + raw_json = f.read() + + except Exception as e: + print "Failed to retrieve stats.", + print "Uptime Robot may be down:", e user = self.verify() models_served = ModelServedCount.all().get()