~emersion/public-inbox

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

Details
Message ID
<pyV1GrDOX5MOzNXI6lwkY_5oNpE3xY0TUN9-KbPLPwpjemkeIUzBPjBKjxzLEH8xhKjvxT_8hOw4-kKc58O837xqYzeHdrWSiLuw_mTpnEU=@emersion.fr>
DKIM signature
pass
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
Export thread (mbox)