From 26bc1dc4358bad1db3ccc3fe3619f00f07946f31 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 22 Mar 2010 21:57:44 +0100 Subject: [PATCH] Fail hard if Spotify login fails --- mopidy/backends/despotify.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mopidy/backends/despotify.py b/mopidy/backends/despotify.py index 9e429606..f75c2d9c 100644 --- a/mopidy/backends/despotify.py +++ b/mopidy/backends/despotify.py @@ -51,10 +51,14 @@ class DespotifyBackend(BaseBackend): def _connect(self): logger.info(u'Connecting to Spotify') - return DespotifySessionManager( - settings.SPOTIFY_USERNAME.encode(ENCODING), - settings.SPOTIFY_PASSWORD.encode(ENCODING), - core_queue=self.core_queue) + try: + return DespotifySessionManager( + settings.SPOTIFY_USERNAME.encode(ENCODING), + settings.SPOTIFY_PASSWORD.encode(ENCODING), + core_queue=self.core_queue) + except spytify.SpytifyError as e: + logger.exception(e) + sys.exit(1) class DespotifyCurrentPlaylistController(BaseCurrentPlaylistController):