resources: Replace error handling in GetRemote with try (note)

Closes #13216
This commit is contained in:
Bjørn Erik Pedersen
2025-01-05 15:43:18 +01:00
parent 4ea94c451d
commit 0918e087ec
16 changed files with 108 additions and 223 deletions

View File

@@ -224,9 +224,6 @@ type resourceCopier interface {
// Copy copies r to the targetPath given.
func Copy(r resource.Resource, targetPath string) resource.Resource {
if r.Err() != nil {
panic(fmt.Sprintf("Resource has an .Err: %s", r.Err()))
}
return r.(resourceCopier).cloneTo(targetPath)
}
@@ -439,10 +436,6 @@ func (l *genericResource) Content(context.Context) (any, error) {
return hugio.ReadString(r)
}
func (r *genericResource) Err() resource.ResourceError {
return nil
}
func (l *genericResource) Data() any {
return l.sd.Data
}