diff options
author | b10c <[email protected]> | 2024-08-14 13:24:58 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-14 13:24:58 +0200 |
commit | 5220d371ea49299e0b1a539fe3ead8d406d74a60 (patch) | |
tree | 45bdf604c43a40c545bd1206b07a6034c6f8ea32 /resources | |
parent | b2d4f67a881ac55f9e47f57bbd81db621848a4ae (diff) | |
download | hugo-5220d371ea49299e0b1a539fe3ead8d406d74a60.tar.gz hugo-5220d371ea49299e0b1a539fe3ead8d406d74a60.zip |
resources: Add URI GetRemote error
Previouly, only "ERROR failed to fetch remote resource: Forbidden"
would be shown when a resource failed to load. In my case, a tweet's
author I was embedding using the twitter shortcode switched his profile
to private which resulted in my blog failing to build. To figure out
where the originates, I added the log to the error message.
Diffstat (limited to 'resources')
-rw-r--r-- | resources/resource_factories/create/remote.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/resources/resource_factories/create/remote.go b/resources/resource_factories/create/remote.go index 606110d57..3bfb5f3cc 100644 --- a/resources/resource_factories/create/remote.go +++ b/resources/resource_factories/create/remote.go @@ -213,7 +213,7 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou } if res.StatusCode < 200 || res.StatusCode > 299 { - return nil, toHTTPError(fmt.Errorf("failed to fetch remote resource: %s", http.StatusText(res.StatusCode)), res, !isHeadMethod) + return nil, toHTTPError(fmt.Errorf("failed to fetch remote resource from '%s': %s", uri, http.StatusText(res.StatusCode)), res, !isHeadMethod) } var ( |