Spotify backend: better error handling.

This commit is contained in:
Antoine Pierlot-Garcin 2011-03-30 00:49:51 -04:00
parent ab1f9d0cc6
commit e0b212a275

View File

@ -34,6 +34,9 @@ class SpotifySessionManager(spotify.manager.SpotifySessionManager, BaseThread):
def logged_in(self, session, error):
"""Callback used by pyspotify"""
if error:
logger.error(u'Spotify login error: %s', error)
return
logger.info(u'Connected to Spotify')
self.session = session
if settings.SPOTIFY_HIGH_BITRATE:
@ -55,7 +58,7 @@ class SpotifySessionManager(spotify.manager.SpotifySessionManager, BaseThread):
def connection_error(self, session, error):
"""Callback used by pyspotify"""
logger.error(u'Connection error: %s', error)
logger.error(u'Spotify connection error: %s', error)
def message_to_user(self, session, message):
"""Callback used by pyspotify"""