w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
351 stars 38 forks source link

Allow intercepts to provide a list of known network error types #508

Open jgraham opened 1 year ago

jgraham commented 1 year ago

The main work here is to work out what the specific types of error we can talk about in a cross-browser way. Once we have that, most of the actual behaviour is defined by the implementation's network stack.

thiagowfx commented 11 months ago

CDP reference (could be used as a starting point for a subset of errors): https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-ErrorReason

Allowed Values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
Lightning00Blade commented 3 months ago

@jgraham I looked a little bit in this. A good starting point can be Aborted one as that has reference in the Fetch spec. And it translates to user has aborted the request (via AbortController).

All the other CDP accepted strings look like TCP errors. There seems to be no list of them on the TCP spec itself.

The CDP map is defined here and all network errors here

Another spec that uses TCP errors - https://www.w3.org/TR/network-error-logging/#secure-connection-establishment-errors also does not link back to the spec.

With this in mind I think we should agree on a sub-set that of them or define them as string with a optional if implementation does not support it throw "unsupported operation" error.