Skip to content

Commit 658e28a

Browse files
committed
Improve "failed to write payload" error handling
See #24
1 parent 4d97c01 commit 658e28a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: transpiler.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,11 @@ func (t *Transpiler) sendInboundMessage(compilationID uint32, message *embeddeds
531531
return err
532532
}
533533

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

539-
return err
538+
return nil
540539
}
541540

542541
type call struct {

0 commit comments

Comments
 (0)