From 7e60b3a78954814bb9a3ef1d92cdb1c4674c211a Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sun, 20 Dec 2020 23:04:26 +0300 Subject: [PATCH] simplify debug Signed-off-by: Vasiliy Tolstov --- file.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file.go b/file.go index 7ac7910..b4f435e 100644 --- a/file.go +++ b/file.go @@ -3,6 +3,7 @@ package file import ( "context" "errors" + "fmt" "io" "io/ioutil" "os" @@ -57,7 +58,7 @@ func (c *fileConfig) Load(ctx context.Context) error { fp, err := os.OpenFile(c.path, os.O_RDONLY, os.FileMode(0400)) if err != nil && !c.opts.AllowFail { - return ErrPathNotExist + return fmt.Errorf("failed to open: %s, error: %w", c.path, ErrPathNotExist) } else if err == nil { defer fp.Close() var buf []byte