From 14cd81198c618843473f3f143aa7976d745e1e15 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Fri, 24 Jul 2015 15:08:24 -0700 Subject: [PATCH] Show exact file being parsed on error. When there's more than on json file in there we don't tell the user which one was an issue. Signed-off-by: Doug Davis Upstream-commit: 76106b494b375cbbf274b10dd1dddfe39e6fcde9 Component: engine --- components/engine/trust/trusts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/engine/trust/trusts.go b/components/engine/trust/trusts.go index 885127ee5d..dd30869daf 100644 --- a/components/engine/trust/trusts.go +++ b/components/engine/trust/trusts.go @@ -3,6 +3,7 @@ package trust import ( "crypto/x509" "errors" + "fmt" "io/ioutil" "net/http" "net/url" @@ -81,12 +82,12 @@ func (t *TrustStore) reload() error { for i, match := range matches { f, err := os.Open(match) if err != nil { - return err + return fmt.Errorf("Error opening %q: %s", match, err) } statements[i], err = trustgraph.LoadStatement(f, nil) if err != nil { f.Close() - return err + return fmt.Errorf("Error loading %q: %s", match, err) } f.Close() }