mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
resources: Replace error handling in GetRemote with try (note)
Closes #13216
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user