add message when network is unavailable (#148)

Co-authored-by: frozenpandaman <7245874+frozenpandaman@users.noreply.github.com>
This commit is contained in:
Sou Niyari 2023-11-09 10:21:49 +09:00 committed by GitHub
parent 56099581a3
commit 718fa4adaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,12 @@ def get_web_view_ver(bhead=[], gtoken=""):
if gtoken:
app_cookies["_gtoken"] = gtoken # X-GameWebToken
home = requests.get(SPLATNET3_URL, headers=app_head, cookies=app_cookies)
try:
home = requests.get(SPLATNET3_URL, headers=app_head, cookies=app_cookies)
except requests.exceptions.ConnectionError:
print("Could not connect to network. Please try again.")
sys.exit(1)
if home.status_code != 200:
return WEB_VIEW_VER_FALLBACK