mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-25 06:42:13 +00:00
add errors and such to log failure messages
This commit is contained in:
parent
2020aa5d10
commit
1b4f407655
@ -214,18 +214,18 @@ func (pm *ProviderManager) getProvKeys() (func() (*cid.Cid, bool), error) {
|
||||
for e := range res.Next() {
|
||||
parts := strings.Split(e.Key, "/")
|
||||
if len(parts) != 4 {
|
||||
log.Warning("incorrectly formatted provider entry in datastore")
|
||||
log.Warningf("incorrectly formatted provider entry in datastore: %s", e.Key)
|
||||
continue
|
||||
}
|
||||
decoded, err := base32.RawStdEncoding.DecodeString(parts[2])
|
||||
if err != nil {
|
||||
log.Warning("error decoding base32 provider key")
|
||||
log.Warning("error decoding base32 provider key: %s: %s", parts[2], err)
|
||||
continue
|
||||
}
|
||||
|
||||
c, err := cid.Cast(decoded)
|
||||
if err != nil {
|
||||
log.Warning("error casting key to cid from datastore key")
|
||||
log.Warning("error casting key to cid from datastore key: %s", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user