优化错误处理相关代码

This commit is contained in:
GoEdgeLab
2023-08-11 14:51:23 +08:00
parent 85b6692548
commit fdc82542ee
10 changed files with 16 additions and 17 deletions

View File

@@ -324,7 +324,7 @@ func (this *Node) syncConfig(taskVersion int64) error {
if os.IsNotExist(clusterErr) {
return errors.New("can not find config file 'configs/api.yaml'")
}
return errors.New("check cluster config failed: " + clusterErr.Error())
return fmt.Errorf("check cluster config failed: %w", clusterErr)
}
} else {
return err