Skip to content

Commit

Permalink
#178 fix issue where Identifier returning error (#179)
Browse files Browse the repository at this point in the history
#144 Not finding a robots.txt is not an error, just information.
  • Loading branch information
valentinedwv authored Mar 21, 2023
1 parent 20a4b3a commit 51fc26e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions internal/common/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func GetIdentifierByPath(jsonPath string, jsonld string) (interface{}, error) {
// we need to sort the results
aString := make([]string, len(ys))
for i, v := range ys {
aString[i] = v.(string)
//aString[i] = v.(string)
aString[i] = fmt.Sprint(v) // v not always a single string
}
sort.SliceStable(aString, func(i, j int) bool {
return aString[i] < aString[j]
Expand Down Expand Up @@ -153,7 +154,7 @@ func GenerateIdentifierSha(v1 *viper.Viper, source config.Sources, jsonld string
}
return id, err
} else {
log.Error(config.IdentifierSha, "Action: Getting normalized sha Error:", err)
log.Info(config.IdentifierSha, "Action: Getting normalized sha Error:", err)
// generate a filesha
return GenerateNormalizedSha(v1, jsonld)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/summoner/acquire/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ResourceURLs(v1 *viper.Viper, mc *minio.Client, headless bool, db *bolt.DB)
} else {
robots, err = getRobotsForDomain(domain.Domain)
if err != nil {
log.Error("Error getting robots.txt for ", domain.Name, ", continuing without it.")
log.Info("Error getting robots.txt for ", domain.Name, ", continuing without it.")
robots = nil
group = nil
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func getRobotsForDomain(url string) (*robotstxt.RobotsData, error) {
log.Info("Getting robots.txt from ", robotsUrl)
robots, err := getRobotsTxt(robotsUrl)
if err != nil {
log.Error("error getting robots.txt for ", url, ":", err)
log.Info("error getting robots.txt for ", url, ":", err)
return nil, err
}
return robots, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/summoner/acquire/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func getRobotsTxt(robotsUrl string) (*robotstxt.RobotsData, error) {

resp, err := client.Do(req)
if err != nil {
log.Error("error fetching robots.txt at ", robotsUrl, err)
log.Info("error fetching robots.txt at ", robotsUrl, err)
return nil, err
}

Expand Down

0 comments on commit 51fc26e

Please sign in to comment.