Skip to content

Commit

Permalink
check all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 26, 2024
1 parent 0011571 commit c81658b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/lmd/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ func (res *Response) JSON(buf io.Writer) error {
}
}

res.WriteDataResponse(json)
if err := res.WriteDataResponse(json); err != nil {
return err
}

json.WriteRaw("]")
err := json.Flush()
Expand All @@ -521,7 +523,9 @@ func (res *Response) WrappedJSON(buf io.Writer) error {
defer jsoniter.ConfigCompatibleWithStandardLibrary.ReturnStream(json)

json.WriteRaw("{\"data\":\n[")
res.WriteDataResponse(json)
if err := res.WriteDataResponse(json); err != nil {
return err
}
json.WriteRaw("]\n,\"failed\": {")
num := 0
for k, v := range res.Failed {
Expand Down

0 comments on commit c81658b

Please sign in to comment.