From fcfa2f31d8ae7e842604fdfa748ca9be5324e916 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 29 Jul 2021 11:14:21 +0300 Subject: [PATCH] display path on error Signed-off-by: Vasiliy Tolstov --- consul.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/consul.go b/consul.go index 118f45a..f17bf98 100644 --- a/consul.go +++ b/consul.go @@ -89,9 +89,9 @@ func (c *consulConfig) Load(ctx context.Context, opts ...config.LoadOption) erro pair, _, err := c.cli.KV().Get(c.path, nil) if err != nil && !c.opts.AllowFail { - return fmt.Errorf("consul path load error: %v", err) + return fmt.Errorf("consul path %s load error: %v", c.path, err) } else if pair == nil && !c.opts.AllowFail { - return fmt.Errorf("consul path not found %s", c.path) + return fmt.Errorf("consul path %s not found", c.path) } if err == nil && pair != nil { @@ -140,7 +140,7 @@ func (c *consulConfig) Save(ctx context.Context, opts ...config.SaveOption) erro } if err != nil && !c.opts.AllowFail { - return fmt.Errorf("consul path save error: %v", err) + return fmt.Errorf("consul path %s save error: %v", c.path, err) } for _, fn := range c.opts.AfterSave {