Open darix opened 1 month ago
alternatively the error could bubble up to the caller location to make it easier to find the line location that caused this.
Encountered error "Forbidden" while fetching tweet ...
if we would let it bubble up it would also give the possibility to say "oh if rendering this failed i ignore it" and make the render a noop
updated patch for 0.127.0
diff --git a/resources/resource_factories/create/remote.go b/resources/resource_factories/create/remote.go
index 5f4879dfe..d1cc9ede1 100644
--- a/resources/resource_factories/create/remote.go
+++ b/resources/resource_factories/create/remote.go
@@ -212,7 +212,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 '%s': %s", uri, http.StatusText(res.StatusCode)), res, !isHeadMethod)
}
var (
At least including the uri in the error message would help the user to figure out which resources they need to fix.
Locally I applied this patch to get some ideas what we have to fix as Twitter gave us some 403.