summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-06-13 16:33:41 +0200
committerBjørn Erik Pedersen <[email protected]>2022-06-14 09:47:41 +0200
commit66da1b7b2f8a8bd26ed4a50a54f64489f116f484 (patch)
treeb1325453b318e00022ff445fedf0f0adb08f678e
parent5a9ecb82a39886a7241ec656fc980f20c1b8dd1c (diff)
downloadhugo-66da1b7b2f8a8bd26ed4a50a54f64489f116f484.tar.gz
hugo-66da1b7b2f8a8bd26ed4a50a54f64489f116f484.zip
resources: Panic on Copy of Resource with .Err
Fixes #10006
-rw-r--r--resources/resource.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/resources/resource.go b/resources/resource.go
index 5773977a2..fd60fd4f6 100644
--- a/resources/resource.go
+++ b/resources/resource.go
@@ -128,6 +128,9 @@ 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)
}