Skip to content
This repository was archived by the owner on May 29, 2018. It is now read-only.

Commit 1c9560d

Browse files
committed
Merge pull request #248 from sourcegraph/file-not-found
robust file-not-found check
2 parents 98e841e + 852045d commit 1c9560d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/store_cmds.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ func Import(buildDataFS vfs.FileSystem, stor interface{}, opt ImportOpt) error {
269269
case *grapher.GraphUnitRule:
270270
var data graph.Output
271271
if err := readJSONFileFS(buildDataFS, rule.Target(), &data); err != nil {
272-
if os.IsNotExist(err) {
272+
// checking if the error begins with "file not found" is necessary because the FS may not be the actual OS FS, in which case os.IsNotExist(err) == false
273+
if os.IsNotExist(err) || strings.HasPrefix(err.Error(), "file not found:") {
273274
log.Printf("Warning: no build data for unit %s %s.", rule.Unit.Type, rule.Unit.Name)
274275
return nil
275276
}

0 commit comments

Comments
 (0)