From cbf0ee1c5a6cadaa12ccb2642622b39f4cf6d950 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:43:43 -0700 Subject: [PATCH 1/2] umu_run: handle gaierror separately from OSError --- umu/umu_run.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/umu/umu_run.py b/umu/umu_run.py index 60dd84928..5386712ed 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -20,7 +20,7 @@ from pathlib import Path from pwd import getpwuid from re import match -from socket import AF_INET, SOCK_DGRAM, socket +from socket import AF_INET, SOCK_DGRAM, gaierror, socket from subprocess import Popen from typing import Any @@ -787,11 +787,14 @@ def main() -> int: # noqa: D103 try: future.result() + except gaierror as e: + # Network address-related errors in the request to repo.steampowered.com + # At this point, the user's network was reachable on launch, but the network + # suddenly became unreliable so the request failed. + log.exception(e) except OSError as e: - # Name resolution failed or unreachable network error in the - # request to repo.steampowered.com. At this point, umu was already - # setup and user is offline or has an unreliable network connection - if e.errno != -3 and e.errno != ENETUNREACH: + # Unreachable network error in the request to repo.steampowered.com. + if e.errno != ENETUNREACH: raise log.debug("Network is unreachable") From 69ee0b40ce1911b9a1ec95ba31ee40e43ad2b276 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:15:47 -0700 Subject: [PATCH 2/2] umu_run: update comments --- umu/umu_run.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/umu/umu_run.py b/umu/umu_run.py index 5386712ed..099c76722 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -789,11 +789,12 @@ def main() -> int: # noqa: D103 future.result() except gaierror as e: # Network address-related errors in the request to repo.steampowered.com - # At this point, the user's network was reachable on launch, but the network - # suddenly became unreliable so the request failed. + # At this point, the user's network was reachable on launch, but + # the network suddenly became unreliable so the request failed. log.exception(e) except OSError as e: - # Unreachable network error in the request to repo.steampowered.com. + # Similar situation as above, but the host was resolved yet the + # network suddenly became unreachable in the request to repo.steampowered.com. if e.errno != ENETUNREACH: raise log.debug("Network is unreachable")