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.
This commit is contained in:
Goffi 2023-11-02 12:11:21 +01:00
commit 221c73b947

View file

@ -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