Skip to content

Commit ddeaed2

Browse files
committed
Pass through close errors
1 parent 780bda4 commit ddeaed2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

conn.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ func (c *Conn) readTillMsg(ctx context.Context) (header, error) {
236236
if h.opcode.controlOp() {
237237
err = c.handleControl(ctx, h)
238238
if err != nil {
239+
// Pass through CloseErrors.
240+
if CloseStatus(err) != -1 {
241+
return header{}, err
242+
}
239243
return header{}, fmt.Errorf("failed to handle control frame %v: %w", h.opcode, err)
240244
}
241245
continue

0 commit comments

Comments
 (0)