From 461d038f01e0a6b6dea7ccee1b37a9e3f09d44f0 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 29 Jul 2021 11:13:26 +0300 Subject: [PATCH] display path on error Signed-off-by: Vasiliy Tolstov --- consul.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/consul.go b/consul.go index 7029d2c..118f45a 100644 --- a/consul.go +++ b/consul.go @@ -2,7 +2,6 @@ package consul import ( "context" - "errors" "fmt" "github.com/hashicorp/consul/api" @@ -13,7 +12,6 @@ import ( var ( DefaultStructTag = "consul" - ErrPathNotExist = errors.New("path is not exist") ) type consulConfig struct { @@ -93,7 +91,7 @@ func (c *consulConfig) Load(ctx context.Context, opts ...config.LoadOption) erro if err != nil && !c.opts.AllowFail { return fmt.Errorf("consul path load error: %v", err) } else if pair == nil && !c.opts.AllowFail { - return fmt.Errorf("consul path not found %v", ErrPathNotExist) + return fmt.Errorf("consul path not found %s", c.path) } if err == nil && pair != nil {