From ff6669a58d34fd98177224e90683c6d05506056a Mon Sep 17 00:00:00 2001 From: diamondburned Date: Tue, 11 Feb 2020 09:23:42 -0800 Subject: [PATCH] internal/wsutil: Fixed error checking --- internal/wsutil/conn.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/wsutil/conn.go b/internal/wsutil/conn.go index f9502a6..68af118 100644 --- a/internal/wsutil/conn.go +++ b/internal/wsutil/conn.go @@ -70,6 +70,10 @@ func (c *Conn) Dial(ctx context.Context, addr string) error { c.Conn, _, err = websocket.Dial(ctx, addr, &websocket.DialOptions{ HTTPHeader: headers, }) + if err != nil { + return errors.Wrap(err, "Failed to dial WS") + } + c.Conn.SetReadLimit(WSReadLimit) c.events = make(chan Event)