mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 07:23:41 +08:00
setup: show failure on any HTTP error (#39324)
This commit is contained in:
committed by
firestar5683
parent
0b35031a88
commit
7228d6a4e0
@@ -563,6 +563,8 @@ class Setup(Widget):
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code == 409:
|
||||
self._download_failed_reason = "Incompatible openpilot version."
|
||||
else:
|
||||
self._download_failed_reason = f"Server error ({e.code}): " + self.download_url.replace("https://", "", 1)
|
||||
except Exception:
|
||||
self._download_failed_reason = "Invalid URL: " + self.download_url.replace("https://", "", 1)
|
||||
|
||||
|
||||
@@ -408,6 +408,8 @@ class Setup(Widget):
|
||||
if e.code == 409:
|
||||
error_msg = e.read().decode("utf-8")
|
||||
self.download_failed(self.download_url, error_msg)
|
||||
else:
|
||||
self.download_failed(self.download_url, f"Server error ({e.code}).")
|
||||
except Exception:
|
||||
error_msg = "Ensure the entered URL is valid, and the device's internet connection is good."
|
||||
self.download_failed(self.download_url, error_msg)
|
||||
|
||||
Reference in New Issue
Block a user