From e7f600b4e6c88336cb4944535f84060faa787c5b Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 23 Apr 2016 17:18:18 -0700 Subject: [PATCH] Improve error handling re: homedir expansion Useful if the HOME envvar is not set because `vault` was launched in a clean environment (e.g. `env -i vault ...`). --- command/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/config.go b/command/config.go index ffe7903b9..ee866faad 100644 --- a/command/config.go +++ b/command/config.go @@ -53,9 +53,10 @@ func LoadConfig(path string) (*DefaultConfig, error) { path = v } + // NOTE: requires HOME env var to be set path, err := homedir.Expand(path) if err != nil { - return nil, fmt.Errorf("Error expanding config path: %s", err) + return nil, fmt.Errorf("Error expanding config path %s: %s", path, err) } contents, err := ioutil.ReadFile(path)