if quote_id is None: # if we're doing a random quote
# for random quotes, we request 10 at a time, then repopulate our cache when it runs out
if not self.fml_cache:
- self.fml_cache = self._get_fml_quotes('http://api.fmylife.com/view/random/10/nocomment?key=%s&language=en' % self.key_fml)
-
+ try:
+ self.fml_cache = self._get_fml_quotes('http://api.fmylife.com/view/random/10/nocomment?key=%s&language=en' % self.key_fml)
+ except Exception as e:
+ raise FmlException("fmylife.com is temporarily unavailable. Please try again later.")
+
if len(self.fml_cache) == 0:
raise FmlException("fmylife.com is temporarily unavailable. Please try again later.")