display path on error
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
a3438bcc2f
commit
461d038f01
@ -2,7 +2,6 @@ package consul
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/api"
|
"github.com/hashicorp/consul/api"
|
||||||
@ -13,7 +12,6 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
DefaultStructTag = "consul"
|
DefaultStructTag = "consul"
|
||||||
ErrPathNotExist = errors.New("path is not exist")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type consulConfig struct {
|
type consulConfig struct {
|
||||||
@ -93,7 +91,7 @@ func (c *consulConfig) Load(ctx context.Context, opts ...config.LoadOption) erro
|
|||||||
if err != nil && !c.opts.AllowFail {
|
if err != nil && !c.opts.AllowFail {
|
||||||
return fmt.Errorf("consul path load error: %v", err)
|
return fmt.Errorf("consul path load error: %v", err)
|
||||||
} else if pair == nil && !c.opts.AllowFail {
|
} 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 {
|
if err == nil && pair != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user