Skip to content

Commit

Permalink
Added error management for FormatConceptFilesIn
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Nestorow <[email protected]>
  • Loading branch information
PiotrNestor committed Jul 4, 2024
1 parent 9bd969b commit 4171a21
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions formatter/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,22 @@ func FormatSpecFilesIn(filesLocation string) {
func FormatConceptFilesIn(filesLocation string) {
conceptFiles := util.FindConceptFiles([]string{filesLocation})
conceptsDictionary := gauge.NewConceptDictionary()
parser.AddConcepts(conceptFiles, conceptsDictionary)
if _, errs, e := parser.AddConcepts(conceptFiles, conceptsDictionary); len(errs) > 0 {
for _, err := range errs {
logger.Errorf(false, "Concept parse failure: %s %s", conceptFiles[0], err)
}
if e != nil {
logger.Errorf(false, "Concept failure: %s %s", conceptFiles[0], e)
os.Exit(1)
}
}
conceptMap := FormatConcepts(conceptsDictionary)
for file, formatted := range conceptMap {
common.SaveFile(file, formatted, true)
e := common.SaveFile(file, formatted, true)
if e != nil {
logger.Errorf(false, "Concept file save failure: %s", e)
os.Exit(1)
}

}
}

0 comments on commit 4171a21

Please sign in to comment.