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>The warning is probably shown using <code>qWarning()</code>, so you should be able to use <a href="http://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler" rel="nofollow"><code>qInstallMessageHandler</code></a> (part of <code>PyQt5.QtCore</code> in PyQt) to catch them.</p>

python qt pyqt