Skip to content

Commit 3bbb6fc

Browse files
committed
log but do not fail if hint does not match data type
1 parent 25b5ece commit 3bbb6fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

engine/linksystem.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,16 @@ func (e *Engine) mkLinkSystem() ipld.LinkSystem {
6666
if isAdvertisement(n) {
6767
if cidSchemaType != "" && cidSchemaType != ipnisync.CidSchemaAdvertisement {
6868
log.Errorf("Retrieved advertisement when asked for %s", cidSchemaType)
69-
return nil, errors.New("data does not match requested type")
69+
} else {
70+
log.Debugw("Retrieved advertisement from datastore", "cid", c, "size", len(val))
7071
}
71-
log.Debugw("Retrieved advertisement from datastore", "cid", c, "size", len(val))
7272
return bytes.NewBuffer(val), nil
7373
}
7474
log.Debugw("Retrieved non-advertisement object from datastore", "cid", c, "size", len(val))
7575
}
7676

7777
if cidSchemaType != "" && cidSchemaType != ipnisync.CidSchemaEntryChunk {
7878
log.Errorf("Asked for %s when expecting %s", cidSchemaType, ipnisync.CidSchemaEntryChunk)
79-
return nil, errors.New("requested unexpected data type")
8079
}
8180

8281
// Not an advertisement, so this means we are receiving ingestion data.

0 commit comments

Comments
 (0)