From ac6785448e8e0bb2c7e7f5a4ff97b1d2972d477f Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Tue, 6 Sep 2022 09:31:37 +0200 Subject: [PATCH] More descriptive errors --- pkg/archive/fsBackend.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/archive/fsBackend.go b/pkg/archive/fsBackend.go index f23221a..a420991 100644 --- a/pkg/archive/fsBackend.go +++ b/pkg/archive/fsBackend.go @@ -53,12 +53,14 @@ func loadJobMeta(filename string) (schema.JobMeta, error) { func (fsa *FsArchive) Init(rawConfig json.RawMessage) error { var config FsArchiveConfig if err := json.Unmarshal(rawConfig, &config); err != nil { + fmt.Errorf("fsBackend Init()- %w", err) return err } fsa.path = config.Path entries, err := os.ReadDir(fsa.path) if err != nil { + fmt.Errorf("fsBackend Init()- Cannot read dir %s: %w", fsa.path, err) return err } @@ -96,7 +98,7 @@ func (fsa *FsArchive) LoadJobMeta(job *schema.Job) (schema.JobMeta, error) { func (fsa *FsArchive) LoadClusterCfg(name string) (model.Cluster, error) { f, err := os.Open(filepath.Join(fsa.path, name, "cluster.json")) if err != nil { - return model.Cluster{}, err + return model.Cluster{}, fmt.Errorf("fsBackend LoadClusterCfg()- Cannot open %s: %w", name, err) } defer f.Close()