Skip to content

Commit

Permalink
log but do not fail if hint does not match data type
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Feb 13, 2025
1 parent 25b5ece commit 3bbb6fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions engine/linksystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,16 @@ func (e *Engine) mkLinkSystem() ipld.LinkSystem {
if isAdvertisement(n) {
if cidSchemaType != "" && cidSchemaType != ipnisync.CidSchemaAdvertisement {
log.Errorf("Retrieved advertisement when asked for %s", cidSchemaType)
return nil, errors.New("data does not match requested type")
} else {
log.Debugw("Retrieved advertisement from datastore", "cid", c, "size", len(val))
}
log.Debugw("Retrieved advertisement from datastore", "cid", c, "size", len(val))
return bytes.NewBuffer(val), nil
}
log.Debugw("Retrieved non-advertisement object from datastore", "cid", c, "size", len(val))
}

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

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

0 comments on commit 3bbb6fc

Please sign in to comment.