From 9c705ffdfb90681963c4192d4a8afb6f99bd3fef Mon Sep 17 00:00:00 2001 From: code1305 Date: Fri, 16 Apr 2021 19:54:12 +0530 Subject: [PATCH] err fix if target creation fails return right error if any target creation fails. Need to wrap the right error. Signed-off-by: Anshul --- discovery/azure/azure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index d3397861b..13ed0abe8 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -373,7 +373,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) { var tg targetgroup.Group for tgt := range ch { if tgt.err != nil { - return nil, errors.Wrap(err, "unable to complete Azure service discovery") + return nil, errors.Wrap(tgt.err, "unable to complete Azure service discovery") } if tgt.labelSet != nil { tg.Targets = append(tg.Targets, tgt.labelSet)