platform: Wrap command RPC error returns with E.Cause

This commit is contained in:
世界
2026-04-10 12:04:55 +08:00
parent 684ba79113
commit 012db0ef0e
2 changed files with 89 additions and 46 deletions
+2 -2
View File
@@ -180,7 +180,7 @@ func (s *CommandServer) StartOrReloadService(configContent string, options *Over
ExcludePackage: iteratorToArray(options.ExcludePackage),
})
if err != nil {
return err
return E.Cause(err, "start or reload service")
}
return nil
}
@@ -267,7 +267,7 @@ func (h *platformHandler) ServiceReload() error {
func (h *platformHandler) SystemProxyStatus() (*daemon.SystemProxyStatus, error) {
status, err := (*CommandServer)(h).handler.GetSystemProxyStatus()
if err != nil {
return nil, err
return nil, E.Cause(err, "get system proxy status")
}
return &daemon.SystemProxyStatus{
Enabled: status.Enabled,