Can't silence connectionFailure error message
Categories
(Core :: Networking: WebSockets, enhancement, P3)
Tracking
()
People
(Reporter: dan.strokirk, Unassigned)
Details
(Whiteboard: [necko-triaged])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Steps to reproduce:
When there is a network error, Firefox always outputs the connectionFailure to the console, without allowing the user to catch those errors.
For example, run this in the console:
var ws = new WebSocket("wss://example.com")
ws.onerror = e => console.log(e)
Actual results:
Firefox shows the error:
Firefox can’t establish a connection to the server at wss://example.com/.
Expected results:
It would be great to be able to override these error logs in some way.
In some cases, I want to override the onError handler of a websocket, fetch request or XHRRequest and catch failures to provide my own, more specific, error message. I can do that with the javascript error events, but the browser error messages are always shown, which can cause noisy logs.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Looks like we're consistent with Chrome: we throw an error AND call the onerror
callback.
I'm going to redirect this to the relevant team.
Updated•6 years ago
|
Updated•3 years ago
|
Description
•