break generator when happen error (#192)

Co-authored-by: kim <xutao@xiaoheiban.cn>
This commit is contained in:
kingxt
2020-11-07 21:25:52 +08:00
committed by GitHub
parent 57079bf4a4
commit 12327fa07d
8 changed files with 18 additions and 11 deletions

View File

@@ -103,7 +103,7 @@ func doGenToFile(dir, handler string, group spec.Group, route spec.Route, handle
buffer := new(bytes.Buffer)
err = template.Must(template.New("handlerTemplate").Parse(text)).Execute(buffer, handleObj)
if err != nil {
return nil
return err
}
formatCode := formatCode(buffer.String())