code-gen: improve ability to debug failures

Code generation failres were hard to identify and undertand

 * avoid unnececary re-formating & memory allocation
 * return clear formatting errors
This commit is contained in:
Alex Bezzubov
2023-02-16 17:47:44 +01:00
parent 6d99af7bbc
commit 8df9e1ecf2
2 changed files with 8 additions and 16 deletions

View File

@ -134,7 +134,7 @@ func main() {
for _, file := range fileList {
if err := file.generate(file.fileToParse, file.samplesDir, file.outPath, file.tmplPath, file.tmplName, file.commit); err != nil {
log.Fatalf("error generating template %q to %q: %+v", file.tmplPath, file.outPath, err)
log.Fatalf("failed to generate %q from %q - %+v", file.outPath, file.tmplPath, err)
}
}
}