diff options
author | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2011-04-03 15:24:50 +0200 |
---|---|---|
committer | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2011-04-03 15:24:50 +0200 |
commit | 7fc51c64b4f9067c58232e79c6357f64a0179572 (patch) | |
tree | 3646d71d5b85deeb50b06534061944822c842bbe | |
parent | acafb8ac8ed97249a603eb0d4ddfca619d940c06 (diff) |
Lastfm: Handle errors when fetching Last.fm user data (bgo#646539)
-rw-r--r-- | src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs index 22094722a..a6819e34c 100644 --- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs +++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs @@ -132,10 +132,15 @@ namespace Banshee.Lastfm main_box.PackStart (top_artists, false, false, 0); //PackStart (recommended_artists, true, true, 0); - user = new LastfmUserData (username); - recently_loved.SetList (user.RecentLovedTracks); - recently_played.SetList (user.RecentTracks); - top_artists.SetList (user.GetTopArtists (TopType.Overall)); + try { + user = new LastfmUserData (username); + recently_loved.SetList (user.RecentLovedTracks); + recently_played.SetList (user.RecentTracks); + top_artists.SetList (user.GetTopArtists (TopType.Overall)); + } catch (Exception e) { + lastfm.SetStatus ("Failed to get information from your Last.fm profile", true, ConnectionState.InvalidAccount); + Log.Exception (String.Format ("LastfmUserData query failed for {0}", username), e); + } ShowAll (); } |