Skip to content

Commit

Permalink
Improve "failed to write payload" error handling
Browse files Browse the repository at this point in the history
See #24
  • Loading branch information
bep committed Jul 11, 2024
1 parent 4d97c01 commit 7e0d8b1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions transpiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,11 @@ func (t *Transpiler) sendInboundMessage(compilationID uint32, message *embeddeds
return err
}

headerLen, err = t.conn.Write(out)
if headerLen != len(out) {
return errors.New("failed to write payload")
if _, err = t.conn.Write(out); err != nil {
return fmt.Errorf("failed to write payload: %w", err)
}

return err
return nil
}

type call struct {
Expand Down

0 comments on commit 7e0d8b1

Please sign in to comment.