summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Lorentz <bertrand.lorentz@gmail.com>2011-04-03 15:24:50 +0200
committerBertrand Lorentz <bertrand.lorentz@gmail.com>2011-04-03 15:24:50 +0200
commit7fc51c64b4f9067c58232e79c6357f64a0179572 (patch)
tree3646d71d5b85deeb50b06534061944822c842bbe
parentacafb8ac8ed97249a603eb0d4ddfca619d940c06 (diff)
Lastfm: Handle errors when fetching Last.fm user data (bgo#646539)
-rw-r--r--src/Extensions/Banshee.Lastfm/Banshee.Lastfm/LastfmSourceContents.cs13
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 ();
}