From 1b3154511ed933a4c22d3ce74241a53ff70d899f Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Fri, 20 Dec 2024 02:25:26 +1100 Subject: [PATCH] ws_js: return c.closeErr when closed during read --- ws_js.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ws_js.go b/ws_js.go index 5e324c47..497fead0 100644 --- a/ws_js.go +++ b/ws_js.go @@ -158,6 +158,9 @@ func (c *Conn) read(ctx context.Context) (MessageType, []byte, error) { return 0, nil, ctx.Err() case <-c.readSignal: case <-c.closed: + if c.closeErr != nil { + return 0, nil, c.closeErr + } return 0, nil, net.ErrClosed }