Browse files

Change logging to info when network requests fails. Don't cache faili…

…ng responses so we can try again
  • Loading branch information...
1 parent 3292211 commit a730bb3baa1e35889a9641ec89f8a0c560311fe3 @kingosticks committed Feb 23, 2014
Showing with 4 additions and 3 deletions.
  1. +4 −3 mopidy_tunein/tunein.py
View
7 mopidy_tunein/tunein.py
@@ -41,7 +41,8 @@ def _memoized(*args):
except (KeyError, AttributeError):
value = func(*args)
- self.cache[args] = (value, now)
+ if value:
+ self.cache[args] = (value, now)
return value
except TypeError:
@@ -306,7 +307,7 @@ def _tunein(self, variant, args):
data['head']['fault'])
return data['body']
except Exception as e:
- logger.error('Tunein request failed: %s', e)
+ logger.info('Tunein request failed: %s', e)
return {}
@cache()
@@ -325,5 +326,5 @@ def _get_playlist(self, uri):
response.close()
return (data, content_type)
except Exception as e:
- logger.error('Playlist request failed: %s', e)
+ logger.info('Tunein playlist request failed: %s', e)
return (None, None)

0 comments on commit a730bb3

Please sign in to comment.