Skip to content

Commit

Permalink
fix: readArea method error is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
caodj committed Oct 24, 2019
1 parent 929a865 commit d1dc429
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ func (mb *client) readArea(area int, dbNumber int, start int, amount int, wordLe
address = address >> 8
request.Data[28] = byte(address & 0x0FF)

response, err := mb.send(&request)
response, sendError := mb.send(&request)
err = sendError
if err == nil {
if size := len(response.Data); size < 25 {
err = fmt.Errorf(ErrorText(errIsoInvalidDataSize)+"'%v'", len(response.Data))
Expand Down

0 comments on commit d1dc429

Please sign in to comment.