resources: Add more details to .Err
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 24 Mar 2022 07:12:51 +0000 (08:12 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 25 Mar 2022 15:40:36 +0000 (16:40 +0100)
commit9202117ba08286975c723130db60a1c69ff249a0
tree2b5bc26059e47045edaa4bb5ddeb89f4da6a68cd
parenta6fa290f67a858e813480cd19bd5e8e1088771d2
resources: Add more details to .Err

This commit adds a .Data object (a map with `Body`, `StatusCode` etc.) to the .Err returned from `resources.GetRemote`, which means you can now do:

```
{{ with .Err }}
{{ range $k, $v := .Data }}
{{ end }}
{{ end }}
```

Fixes #9708
hugolib/page.go
hugolib/resource_chain_test.go
resources/errorResource.go
resources/page/page_nop.go
resources/page/testhelpers_test.go
resources/resource.go
resources/resource/resourcetypes.go
resources/resource_factories/create/remote.go
resources/transform.go
tpl/resources/resources.go