From 5c6bf841066e0ec2454a23a127c446ab9be30409 Mon Sep 17 00:00:00 2001 From: TwiN Date: Thu, 1 Sep 2022 20:51:37 -0400 Subject: [PATCH] ux: Improve error message when endpoint is invalid --- config/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index eee0a1d0..d9dc3d01 100644 --- a/config/config.go +++ b/config/config.go @@ -2,6 +2,7 @@ package config import ( "errors" + "fmt" "log" "os" "time" @@ -267,7 +268,7 @@ func validateEndpointsConfig(config *Config) error { log.Printf("[config][validateEndpointsConfig] Validating endpoint '%s'", endpoint.Name) } if err := endpoint.ValidateAndSetDefaults(); err != nil { - return err + return fmt.Errorf("invalid endpoint %s: %s", endpoint.DisplayName(), err) } } log.Printf("[config][validateEndpointsConfig] Validated %d endpoints", len(config.Endpoints))