Webview firing did-fail-load when error code is OK


I was about to open a bug for this but I figured I’d check here first.

And after updating form 1.2.6 after a successful navigation my did-fail-load handler is called as expected but I’m also getting a call to my did-fail-load handler. The event passed to the fail handler has “errorCode”:0, “errorDescription”:"OK and “type”: “did-fail-load”. I think this is related to how redirects are handled but I’ve been unable to fully verify that.

I’m listening for did-fail-load and did-finish=load events:

Here’s my error handler

const OK_ERROR_CODE = 0;
function webViewLoadFailed(event) {
    if (event.errorCode === OK_ERROR_CODE) {
        logger.debug("'did-fail-load' called with successful ERROR_CODE")
  // my code that handles errors

Is did-fail-load supposed to fire when a redirect happens?

  • Electron version: 1.4.0
  • Operating system: OS X: 10.11.6


Was there a fix for this? I’m seeing the same issue.


from this doc : https://github.com/electron/electron/blob/master/docs/api/web-contents.md#event-did-fail-load

This event is like did-finish-load but emitted when the load failed or was cancelled, e.g. window.stop() is invoked. The full list of error codes and their meaning is available here.

did you click the links multiple times which causes it cancelled the previous click/navigate event?


Yes, we’re seeing this issue when clicking the link several times in a row. What’s the best way to ignore the error caused by the cancel?


It seems like this should have been fixed in https://github.com/electron/electron/pull/8472, but that’s for error code -3 ERR_ABORTED. I’m not even seeing error code 0 documented in the chromium errors.