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:
b10c
2024-08-14 13:24:58 +02:00
committed by GitHub
parent b2d4f67a88
commit 5220d371ea
2 changed files with 3 additions and 3 deletions

View File

@@ -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 (