Skip to content

Commit

Permalink
Merge pull request #144 from stackrox/lvm/fix-error-handling
Browse files Browse the repository at this point in the history
fix(azure): Fix error handling in the azure crawler
  • Loading branch information
lvalerom authored Dec 9, 2024
2 parents dc42f24 + a3f6d7f commit 158d45a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/crawlers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,12 @@ func (c *azureNetworkCrawler) fetchAll() ([][]byte, error) {
jsonURLs := make([]string, 0, len(c.urls))
for _, url := range c.urls {
jsonURL, err := c.redirectToJSONURL(url)
if err != nil || jsonURL == "" {
if err != nil {
return nil, errors.Wrapf(err, "failed to crawl Azure with URL: %s. Error: %v. JSON URL: %s", url, err, jsonURL)
}
if jsonURL == "" {
return nil, errors.Errorf("failed to crawl Azure with URL: %s, empty JSON URL returned. This could indicate Azure's services are unavailable", url)
}
log.Printf("Received Azure network JSON URL: %s", jsonURL)
jsonURLs = append(jsonURLs, jsonURL)
}
Expand Down

0 comments on commit 158d45a

Please sign in to comment.