mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
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.
This commit is contained in:
@@ -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 (
|
||||
|
Reference in New Issue
Block a user