From a5ba166935512ac786a8e6abec740df38b68ab44 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 25 May 2016 16:05:20 -0700 Subject: [PATCH] retrieval: don't panic on non-HTTP scheme --- retrieval/targetmanager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retrieval/targetmanager.go b/retrieval/targetmanager.go index dc02cae97..bf8b8cb22 100644 --- a/retrieval/targetmanager.go +++ b/retrieval/targetmanager.go @@ -454,7 +454,7 @@ func targetsFromGroup(tg *config.TargetGroup, cfg *config.ScrapeConfig) ([]*Targ case "https": addr = fmt.Sprintf("%s:443", addr) default: - panic(fmt.Errorf("targetsFromGroup: invalid scheme %q", cfg.Scheme)) + return nil, fmt.Errorf("invalid scheme: %q", cfg.Scheme) } labels[model.AddressLabel] = model.LabelValue(addr) }