Skip to content

Commit

Permalink
Merge pull request #235 from R1kaB3rN/improve-gaierror-handling
Browse files Browse the repository at this point in the history
fix: improve network handling on runtime update
  • Loading branch information
R1kaB3rN authored Oct 15, 2024
2 parents 2c6ad34 + 69ee0b4 commit 1d6d2ae
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -787,11 +787,15 @@ 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:
# 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")

Expand Down

0 comments on commit 1d6d2ae

Please sign in to comment.