Code cleanup and improvements.
This commit is contained in:
@@ -603,7 +603,9 @@ def _fetch_small_file(
|
||||
try:
|
||||
response = urlopen(request, timeout=timeout_seconds)
|
||||
except HTTPError as exc:
|
||||
raise LauncherUpdateError(f"{label} request failed: HTTP {exc.code}") from exc
|
||||
status = exc.code
|
||||
exc.close()
|
||||
raise LauncherUpdateError(f"{label} request failed: HTTP {status}") from exc
|
||||
except (URLError, OSError) as exc:
|
||||
raise LauncherUpdateError(f"{label} request failed: {exc}") from exc
|
||||
with response:
|
||||
@@ -695,8 +697,10 @@ def _download_archive(
|
||||
try:
|
||||
response = urlopen(request, timeout=timeout_seconds)
|
||||
except HTTPError as exc:
|
||||
status = exc.code
|
||||
exc.close()
|
||||
raise LauncherUpdateError(
|
||||
f"launcher archive request failed: HTTP {exc.code}"
|
||||
f"launcher archive request failed: HTTP {status}"
|
||||
) from exc
|
||||
except (URLError, OSError) as exc:
|
||||
raise LauncherUpdateError(f"launcher archive request failed: {exc}") from exc
|
||||
|
||||
Reference in New Issue
Block a user