We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
diff --git a/resources/resource_factories/create/remote.go b/resources/resource_factories/create/remote.go index c2d17e7a5..9424fc5a0 100644 --- a/resources/resource_factories/create/remote.go +++ b/resources/resource_factories/create/remote.go @@ -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 '%s': %s", uri, http.StatusText(res.StatusCode)), res, !isHeadMethod) } }
The text was updated successfully, but these errors were encountered:
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 ...
Sorry, something went wrong.
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 (
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: