Skip to content

Commit

Permalink
Be smarter when handling zenity errors
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
R1kaB3rN committed Mar 19, 2024
1 parent e66679b commit f9e2114
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ULWGL/ulwgl_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9e2114

Please sign in to comment.