Code cleanup and improvements.
This commit is contained in:
@@ -64,9 +64,11 @@ def fetch_official_launcher(
|
||||
try:
|
||||
response = urlopen(request, timeout=timeout_seconds)
|
||||
except HTTPError as exc:
|
||||
if exc.code == 304 and destination.is_file():
|
||||
status = exc.code
|
||||
exc.close()
|
||||
if status == 304 and destination.is_file():
|
||||
return _existing_download(destination, metadata, url)
|
||||
raise DownloadError(f"official launcher request failed: HTTP {exc.code}") from exc
|
||||
raise DownloadError(f"official launcher request failed: HTTP {status}") from exc
|
||||
except OSError as exc:
|
||||
raise DownloadError(f"official launcher request failed: {exc}") from exc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user