Session creation exception handling.
[clinton/xbmc-groove.git] / default.py
index 884d412..5c98792 100644 (file)
@@ -43,7 +43,13 @@ listBackground = os.path.join(imgDir, 'listbackground.png')
 
 sys.path.append (libDir)
 from GrooveAPI import GrooveAPI
-groovesharkApi = GrooveAPI()
+try:
+    groovesharkApi = GrooveAPI()
+except:
+    dialog = xbmcgui.Dialog()
+    dialog.ok('Grooveshark XBMC', 'Unable to connect with Grooveshark.', 'Please try again later')
+    sys.exit(-1)
+  
 
 class _Info:
     def __init__( self, *args, **kwargs ):