mackstann / mpris-remote

command line tool for interacting with music players that support the mpris spec
http://incise.org/mpris-remote.html
25 stars 10 forks source link

Ugly traceback when dbus isn't found #3

Open mackstann opened 13 years ago

mackstann commented 13 years ago

http://mapopa.blogspot.com/2010/08/mpris-support-in-qmmp.html

In case that page disappears, the problem is triggered by this bit of code:

bus = dbus.SessionBus()

And the exception is this:

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

mpris-remote should catch this exception and tell the user that dbus isn't running in a more obvious manner.