From 221c73b9477eb451a0ae573e17e8649abd234347 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 2 Nov 2023 12:11:21 +0100 Subject: [PATCH] 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. --- libervia/frontends/tools/webrtc.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libervia/frontends/tools/webrtc.py b/libervia/frontends/tools/webrtc.py index 1527ed1d..c9a86451 100644 --- a/libervia/frontends/tools/webrtc.py +++ b/libervia/frontends/tools/webrtc.py @@ -23,12 +23,14 @@ gi.require_versions({ }) 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 @@ import re 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