Open Bug 1545215 Opened 6 years ago Updated 3 years ago

Can't silence connectionFailure error message

Categories

(Core :: Networking: WebSockets, enhancement, P3)

67 Branch
enhancement

Tracking

()

UNCONFIRMED

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.

Component: Untriaged → Console
Product: Firefox → DevTools

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.

Component: Console → Networking: WebSockets
Product: DevTools → Core
Summary: Can't silence connectionFailure error message in Console → Can't silence connectionFailure error message
Type: defect → enhancement
Priority: -- → P3
Whiteboard: [necko-triaged]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.