Skip to content

Commit

Permalink
better error
Browse files Browse the repository at this point in the history
  • Loading branch information
elee1766 committed Oct 26, 2023
1 parent 64f97e7 commit dca920e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion w.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type Writer struct {
func (w *Writer) Write(p []byte) (n int, err error) {
if w.stream != nil {
if len(w.Buf) > 0 {
w.Flush()
if w.Flush() {
return 0, w.stream.writeErr
}
}
return w.stream.writer.Write(p)
}
Expand Down

0 comments on commit dca920e

Please sign in to comment.