Skip to content

Commit

Permalink
fix error handling in the azure crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
lvalerom committed Dec 9, 2024
1 parent dc42f24 commit a3f6d7f
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 a3f6d7f

Please sign in to comment.