Update source->V4.9.9.17493

This commit is contained in:
Yanam1Anna
2025-06-08 15:04:34 +08:00
parent 9e85a1456f
commit d0a0190ccd
2 changed files with 21 additions and 3 deletions

View File

@@ -215,7 +215,7 @@ class Ui_mainwin(object):
def retranslateUi(self, mainwin): def retranslateUi(self, mainwin):
mainwin.setWindowTitle( mainwin.setWindowTitle(
QCoreApplication.translate( QCoreApplication.translate(
"mainwin", "FRAISEMOE Addons Installer V4.9.5.17465", None "mainwin", "FRAISEMOE Addons Installer V4.9.9.17493", None
) )
) )
self.mainbg.setText("") self.mainbg.setText("")

View File

@@ -384,11 +384,29 @@ class MyWindow(QWidget, Ui_mainwin):
return { return {
f"vol{i+1}": config_data[f"vol.{i+1}.data"]["url"] for i in range(4) f"vol{i+1}": config_data[f"vol.{i+1}.data"]["url"] for i in range(4)
} }
except (requests.exceptions.RequestException, ValueError) as e: except requests.exceptions.RequestException as e:
# 获取 HTTP 状态码
status_code = e.response.status_code if e.response is not None else "未知"
try:
# 尝试从响应中解析 JSON 并提取 title 和 message
error_response = e.response.json() if e.response else {}
json_title = error_response.get("title", "无错误类型")
json_message = error_response.get("message", "无附加错误信息")
except (ValueError, AttributeError):
json_title = "配置文件异常,无法解析错误类型"
json_message = "配置文件异常,无法解析错误信息"
QMessageBox.critical( QMessageBox.critical(
self, self,
f"错误 {APP_NAME}", f"错误 {APP_NAME}",
f"\n下载配置获取失败\n\n错误信息】:{e}\n", f"\n下载配置获取失败\n\nHTTP状态】{status_code}\n【错误类型】:{json_title}\n【错误信息】:{json_message}\n",
)
return {}
except ValueError as e:
QMessageBox.critical(
self,
f"错误 {APP_NAME}",
f"\n配置文件格式异常\n\n【错误信息】:{e}\n",
) )
return {} return {}