Skip to content

Commit

Permalink
feat: error exit (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
FGYFFFF authored Jun 20, 2024
1 parent 6322a62 commit b9d2181
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions validator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ func HandleRequest(req *plugin.Request) *plugin.Response {

g, err := newGenerator(req)
if err != nil {
return &plugin.Response{Warnings: []string{err.Error()}}
errString := err.Error()
return &plugin.Response{Error: &errString}
}
contents, err := g.generate()
if err != nil {
return &plugin.Response{Warnings: []string{err.Error()}}
errString := err.Error()
return &plugin.Response{Error: &errString}
}

warnings = append(warnings, g.warnings...)
Expand Down

0 comments on commit b9d2181

Please sign in to comment.