|
@@ -22,7 +22,7 @@ but without module-echo-cancel it has almost no chance of working.
|
22
|
22
|
from gi.repository import GLib
|
23
|
23
|
from pydbus import SessionBus
|
24
|
24
|
|
25
|
|
-from . import PluginBase, Handler
|
|
25
|
+from . import PluginBase, Handler, HandlerFailure
|
26
|
26
|
|
27
|
27
|
|
28
|
28
|
class Plugin(PluginBase):
|
|
@@ -88,10 +88,7 @@ class MPRISNextHandler(MPRISHandler):
|
88
|
88
|
try:
|
89
|
89
|
self.proxy.Next()
|
90
|
90
|
except GLib.Error:
|
91
|
|
- # This error is raised if the media player was closed after we got
|
92
|
|
- # the proxy but before we called next.
|
93
|
|
- # FIXME raise a different exception to tell Kaylee that we failed
|
94
|
|
- pass
|
|
91
|
+ raise HandlerFailure()
|
95
|
92
|
|
96
|
93
|
|
97
|
94
|
class MPRISPauseHandler(MPRISHandler):
|
|
@@ -102,10 +99,7 @@ class MPRISPauseHandler(MPRISHandler):
|
102
|
99
|
try:
|
103
|
100
|
self.proxy.Pause()
|
104
|
101
|
except GLib.Error:
|
105
|
|
- # This error is raised if the media player was closed after we got
|
106
|
|
- # the proxy but before we called pause.
|
107
|
|
- # FIXME raise a different exception to tell Kaylee that we failed
|
108
|
|
- pass
|
|
102
|
+ raise HandlerFailure()
|
109
|
103
|
|
110
|
104
|
|
111
|
105
|
class MPRISPlayHandler(MPRISHandler):
|
|
@@ -116,10 +110,7 @@ class MPRISPlayHandler(MPRISHandler):
|
116
|
110
|
try:
|
117
|
111
|
self.proxy.Play()
|
118
|
112
|
except GLib.Error:
|
119
|
|
- # This error is raised if the media player was closed after we got
|
120
|
|
- # the proxy but before we called play.
|
121
|
|
- # FIXME raise a different exception to tell Kaylee that we failed
|
122
|
|
- pass
|
|
113
|
+ raise HandlerFailure()
|
123
|
114
|
|
124
|
115
|
|
125
|
116
|
class MPRISPreviousHandler(MPRISHandler):
|
|
@@ -130,7 +121,4 @@ class MPRISPreviousHandler(MPRISHandler):
|
130
|
121
|
try:
|
131
|
122
|
self.proxy.Previous()
|
132
|
123
|
except GLib.Error:
|
133
|
|
- # This error is raised if the media player was closed after we got
|
134
|
|
- # the proxy but before we called previous.
|
135
|
|
- # FIXME raise a different exception to tell Kaylee that we failed
|
136
|
|
- pass
|
|
124
|
+ raise HandlerFailure()
|