diff --git a/flow/cmd/validate_peer.go b/flow/cmd/validate_peer.go index 647c86c07a..bae2a1f8b6 100644 --- a/flow/cmd/validate_peer.go +++ b/flow/cmd/validate_peer.go @@ -61,11 +61,11 @@ func (h *FlowRequestHandler) ValidatePeer( validationConn, ok := conn.(connectors.ValidationConnector) if ok { validErr := validationConn.ValidateCheck(ctx) - displayErr := fmt.Sprintf("failed to validate peer %s: %v", req.Peer.Name, validErr) - h.alerter.LogNonFlowWarning(ctx, telemetry.CreatePeer, req.Peer.Name, - displayErr, - ) if validErr != nil { + displayErr := fmt.Sprintf("failed to validate peer %s: %v", req.Peer.Name, validErr) + h.alerter.LogNonFlowWarning(ctx, telemetry.CreatePeer, req.Peer.Name, + displayErr, + ) return &protos.ValidatePeerResponse{ Status: protos.ValidatePeerStatus_INVALID, Message: displayErr,