How to catch error from QtMultimedia in Python?
<p>I created application in PyQt + QtMultimedia that plays videos. When QtMultimedia can not find backend for playing videos (on Linux it's Gstreamer) it shows this error in terminal:</p>

<p><code>defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"</code></p>

<p>However PyQt doesn't throw exception so I can not catch it in python. Is there a way how to detect this error and show some warning to user?</p>

<p>Take a look at <a href="http://doc.qt.io/qt-5/qmediaplayer.html#mediaStatusChanged" rel="nofollow">the docs</a>.</p>

<p>The problem you describle should be emitting the signal:</p>

<pre><code>QMediaPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus status)
</code></pre>

<p>where status = QMediaPlayer::ServiceMissingError</p>

<p>So, just connect a slot to that signal and manage it.</p>

python qt pyqt