pkg/kademlia: clearer error message (#2824)

This commit is contained in:
Egon Elbre 2019-08-20 12:54:33 +03:00 committed by GitHub
parent 95c88b803c
commit 3c41794429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,7 @@ func (endpoint *Endpoint) RequestInfo(ctx context.Context, req *pb.InfoRequest)
if self.Type == pb.NodeType_STORAGE {
if endpoint.trust == nil {
return nil, status.Error(codes.Internal, "missing trust verifier")
return nil, status.Error(codes.Internal, "missing trust")
}
peer, err := identity.PeerIdentityFromContext(ctx)
@ -116,7 +116,7 @@ func (endpoint *Endpoint) RequestInfo(ctx context.Context, req *pb.InfoRequest)
err = endpoint.trust.VerifySatelliteID(ctx, peer.ID)
if err != nil {
return nil, status.Error(codes.PermissionDenied, "info requested from untrusted peer")
return nil, status.Errorf(codes.PermissionDenied, "untrusted peer %v", peer.ID)
}
}