From a1146c2964162ef4cb71e297688dfe34c7ec9797 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 11 Sep 2012 13:52:43 +0200 Subject: [PATCH] Log error and exit if output creation fails --- mopidy/gstreamer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mopidy/gstreamer.py b/mopidy/gstreamer.py index 2ebe2d71..f131fdfc 100644 --- a/mopidy/gstreamer.py +++ b/mopidy/gstreamer.py @@ -87,9 +87,14 @@ class GStreamer(ThreadingActor): self._pipeline.set_state(gst.STATE_NULL) def _setup_output(self): - # This will raise a gobject.GError if the description is bad. - self._output = gst.parse_bin_from_description( - settings.OUTPUT, ghost_unconnected_pads=True) + try: + self._output = gst.parse_bin_from_description( + settings.OUTPUT, ghost_unconnected_pads=True) + except gobject.GError as ex: + logger.error('Failed to create output "%s": %s', + settings.OUTPUT, ex) + process.exit_process() + return self._pipeline.add(self._output) gst.element_link_many(self._pipeline.get_by_name('queue'),