Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions managedplugin/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func DownloadPluginFromHub(ctx context.Context, localPath string, team string, n
if downloadURL.StatusCode == http.StatusNotFound {
return fmt.Errorf("failed to get plugin url for %v %v/%v@%v: plugin version not found", typ, team, name, version)
}
if downloadURL.StatusCode == http.StatusTooManyRequests {
return fmt.Errorf("failed to get plugin url for %v %v/%v@%v: too many requests. Try logging in via `cloudquery login` to increase rate limits", typ, team, name, version)
}
if downloadURL.StatusCode != http.StatusFound {
return fmt.Errorf("failed to get plugin url for %v %v/%v@%v: unexpected status code %v", typ, team, name, version, downloadURL.StatusCode)
}
location, ok := downloadURL.Header["Location"]
if !ok {
return fmt.Errorf("failed to get plugin url for %v %v/%v@%v: missing location header from response", typ, team, name, version)
Expand Down