Re: [PATCH gamja] Add error reporting on connect and main page

Message ID
DKIM signature
Download raw message
On Wednesday, July 22, 2020 7:49 PM, Vincent Wang <vwangsf@gmail.com> wrote:

> Thanks for the feedback! I'll implement these fixes immediately.

No rush :)

> P.S. As far as I can tell, the try..catch around new WebSocket does
> not actually catch connection errors - they are instead sent to the
> error event handler. Is there another reason for the try..catch
> block?

According to the spec [1], exceptions can be triggered when the
WebSocket URL is invalid. Since this is a user-supplied value, it's
better to catch these errors.

[1]: https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket
Reply to thread Export thread (mbox)