mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-10 11:38:40 +00:00
add URI to resource load 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:
parent
90bc1f802a
commit
cf5d0c1f91
|
@ -138,7 +138,7 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
|
|||
|
||||
if res.StatusCode != http.StatusNotFound {
|
||||
if res.StatusCode < 200 || res.StatusCode > 299 {
|
||||
return nil, temporaryHTTPStatusCodes[res.StatusCode], toHTTPError(fmt.Errorf("failed to fetch remote resource: %s", http.StatusText(res.StatusCode)), res, !isHeadMethod)
|
||||
return nil, temporaryHTTPStatusCodes[res.StatusCode], toHTTPError(fmt.Errorf("failed to fetch remote resource from '%s': %s", uri, http.StatusText(res.StatusCode)), res, !isHeadMethod)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue