changeset 4145:970b6209526a

frontends (tools/webrtc): Better message on Python override missing: raise an exception instead of simple `print` to stop loading the module, and show a more detailed message with the package to install.
author Goffi <goffi@goffi.org>
date Thu, 02 Nov 2023 12:11:21 +0100
parents 14523ee96538
children 60d107f2178a
files libervia/frontends/tools/webrtc.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/frontends/tools/webrtc.py	Wed Nov 01 14:10:31 2023 +0100
+++ b/libervia/frontends/tools/webrtc.py	Thu Nov 02 12:11:21 2023 +0100
@@ -23,12 +23,14 @@
 })
 from gi.repository import Gst, GstWebRTC, GstSdp
 
+from libervia.backend.core import exceptions
+
 try:
     from gi.overrides import Gst as _
 except ImportError:
-    print(
-        "no GStreamer python overrides available, please install relevant pacakges on "
-        "your system."
+    raise exceptions.MissingModule(
+        "No GStreamer Python overrides available. Please install relevant packages on "
+        "your system (e.g., `python3-gst-1.0` on Debian and derivatives)."
     )
 import asyncio
 from dataclasses import dataclass
@@ -38,7 +40,6 @@
 from typing import Callable
 from urllib.parse import quote_plus
 
-from libervia.backend.core import exceptions
 from libervia.backend.tools.common import data_format
 from libervia.frontends.tools import aio