setup: handle incompatible versions (#36520)

check
test_replay
Maxime Desroches 1 week ago committed by GitHub
parent 2e636458a6
commit 9f20eb8ce6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      system/ui/setup.py

@ -4,6 +4,7 @@ import re
import threading import threading
import time import time
import urllib.request import urllib.request
import urllib.error
from urllib.parse import urlparse from urllib.parse import urlparse
from enum import IntEnum from enum import IntEnum
import shutil import shutil
@ -418,6 +419,10 @@ class Setup(Widget):
time.sleep(0.1) time.sleep(0.1)
gui_app.request_close() gui_app.request_close()
except urllib.error.HTTPError as e:
if e.code == 409:
error_msg = e.read().decode("utf-8")
self.download_failed(self.download_url, error_msg)
except Exception: except Exception:
error_msg = "Ensure the entered URL is valid, and the device's internet connection is good." error_msg = "Ensure the entered URL is valid, and the device's internet connection is good."
self.download_failed(self.download_url, error_msg) self.download_failed(self.download_url, error_msg)

Loading…
Cancel
Save