From f9e211476ad97dffd6752bc480f3cd8cd822b514 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 19 Mar 2024 09:57:21 -0700 Subject: [PATCH] Be smarter when handling zenity errors - We shouldn't ever crash the launcher if any kind of zenity error occurs. Just be sure to log the status code and prepare to download from using native Python functionality --- ULWGL/ulwgl_util.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ULWGL/ulwgl_util.py b/ULWGL/ulwgl_util.py index fbf562b9b..c26800172 100644 --- a/ULWGL/ulwgl_util.py +++ b/ULWGL/ulwgl_util.py @@ -89,13 +89,12 @@ def setup_runtime(root: Path, json: Dict[str, Any]) -> None: # noqa: D103 msg: str = "Downloading Runtime, please wait..." ret: int = enable_zenity(bin, opts, msg) - log.debug("Exit code returned from zenity: %s", ret) - # Handle the symbol lookup error from the zenity flatpak in lutris - if ret == 127: + if ret: + log.warning("Zenity exited with the status code: %s", ret) + log.warning("Zenity will not be used") + tmp.joinpath(archive).unlink(missing_ok=True) raise FileNotFoundError - if ret != 0: - raise except TimeoutError: # Without the runtime, the launcher will not work # Just exit on timeout or download failure