mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
Fix: call errors.Wrap with a nil value error err (#6739)
Signed-off-by: alingse <alingse@foxmail.com>
This commit is contained in:
+2
-2
@@ -1626,8 +1626,8 @@ func (h *Installer) renderNotes(addon *InstallPackage) (string, error) {
|
||||
}
|
||||
notesFile := contextFile + "\n" + addon.Notes.Data
|
||||
val := cuecontext.New().CompileString(notesFile)
|
||||
if val.Err() != nil {
|
||||
return "", errors.Wrap(err, "build values for NOTES.cue")
|
||||
if valErr := val.Err(); valErr != nil {
|
||||
return "", errors.Wrap(valErr, "build values for NOTES.cue")
|
||||
}
|
||||
notes := val.LookupPath(cue.ParsePath(KeyWordNotes))
|
||||
if !notes.Exists() {
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ func LoadDataFromPath(ctx context.Context, path string, pathFilter func(string)
|
||||
}
|
||||
bs, e := os.ReadFile(filepath.Clean(path))
|
||||
if e != nil {
|
||||
return nil, fmt.Errorf("failed to read file %s: %w", path, err)
|
||||
return nil, fmt.Errorf("failed to read file %s: %w", path, e)
|
||||
}
|
||||
return []FileData{{Path: path, Data: bs}}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user