diff --git a/lookup.go b/lookup.go index 4029f5e3a96..9a4285d92c6 100644 --- a/lookup.go +++ b/lookup.go @@ -30,7 +30,10 @@ func toPeerInfos(ps []peer.ID) []*pstore.PeerInfo { } func loggableKey(k string) logging.LoggableMap { - if cid, err := cid.Cast([]byte(k)); err == nil { + cid, err := cid.Cast([]byte(k)) + if err != nil { + log.Errorf("loggableKey could not cast key: %v", err) + } else { k = cid.String() } return logging.LoggableMap{