diff --git a/Changelog.md b/Changelog.md
index 5990e4618..45a5b1446 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -16,12 +16,13 @@
- macOS 修复编辑规则时「规则内容」输入的首字母被自动转为大写的问题
- macOS 修复残留的服务进程导致内核无法启动、「继续使用 Sidecar」失败且无法修复的问题
- macOS 优化用户目录在外置磁盘时服务拒绝启动内核的提示:说明原因并给出修复命令
+- macOS 修复服务模式内核意外停止后,系统代理仍指向失效端口导致无法上网的问题
🚀 优化改进
-- 优化内核启动失败提示:显示具体原因,并在窗口恢复后提示尚未解决的启动错误
+- 优化内核启动失败和服务模式内核意外停止的提示:显示具体原因,并在窗口恢复后提示尚未解决的错误
diff --git a/src-tauri/src/cmd/service.rs b/src-tauri/src/cmd/service.rs
index 923cbe8d4..71a286330 100644
--- a/src-tauri/src/cmd/service.rs
+++ b/src-tauri/src/cmd/service.rs
@@ -115,7 +115,7 @@ pub fn take_service_fallback_notice() -> bool {
}
#[tauri::command]
-pub fn get_core_startup_error() -> Option {
+pub fn get_core_startup_error() -> Option {
crate::core::CoreManager::global().get_startup_error()
}
diff --git a/src-tauri/src/core/manager/mod.rs b/src-tauri/src/core/manager/mod.rs
index 4af3acdd6..ae5889e7d 100644
--- a/src-tauri/src/core/manager/mod.rs
+++ b/src-tauri/src/core/manager/mod.rs
@@ -74,6 +74,14 @@ impl fmt::Display for RunningMode {
}
}
+/// Why the Core is not running, kept until a Core starts again.
+#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq)]
+#[serde(tag = "kind", content = "detail", rename_all = "camelCase")]
+pub enum CoreFailure {
+ StartFailed(String),
+ ServiceCoreStopped(String),
+}
+
#[derive(Debug)]
pub struct CoreManager {
/// The Run State this manager reports transitions to.
@@ -87,7 +95,7 @@ pub struct CoreManager {
job_handle: ArcSwapOption,
config_update_in_progress: AtomicBool,
core_readiness_state: AtomicU64,
- startup_error: parking_lot::Mutex