fix(sysproxy): keep the system proxy usable when the core is not ready

This commit is contained in:
wonfen
2026-08-24 19:32:52 +08:00
parent 9085d907cd
commit 8df8edb6dd
21 changed files with 108 additions and 30 deletions
+4
View File
@@ -38,6 +38,8 @@ pub enum SysproxyFailure {
SidecarWhileServiceReady,
/// The proxy guard stopped after repeated failures.
GuardStopped { detail: String },
/// The Core was not ready, so enabling the system proxy was refused.
CoreNotReady,
}
impl SysproxyFailure {
@@ -48,6 +50,7 @@ impl SysproxyFailure {
Self::DirectFallback { .. } => "SYSPROXY_DIRECT_FALLBACK",
Self::SidecarWhileServiceReady => "SYSPROXY_SIDECAR_WHILE_SERVICE_READY",
Self::GuardStopped { .. } => "SYSPROXY_GUARD_STOPPED",
Self::CoreNotReady => "SYSPROXY_CORE_NOT_READY",
}
}
@@ -70,6 +73,7 @@ impl std::fmt::Display for SysproxyFailure {
Self::GuardStopped { detail } => {
write!(f, "system proxy guard stopped after repeated failures: {detail}")
}
Self::CoreNotReady => f.write_str("the core is not ready, so the system proxy was not enabled"),
}
}
}