Chromium Network Errors
Provides Chromium network errors found in net_error_list.h as custom errors for Node.js.
They correspond to the error codes that could be provided by
Electron's did-fail-load
event, for
example.
Install
npm install chromium-net-errors --save
Example Electron app
var app = ;var BrowserWindow = ;var networkErrors = ; app;
Will pop-up the following error:
Uncaught Exception:
NameNotResolvedError: The host name could not be resolved.
at Object.exports.createByCode (/tmp/ele/node_modules/chromium-net-errors/index.js:72:9)
at EventEmitter.<anonymous> (/tmp/ele/app.js:10:25)
at emitThree (events.js:97:13)
at EventEmitter.emit (events.js:172:7)
Usage
var cne = ;
Create new errors
var err = ; console; // trueconsole; // trueconsole; // true
Create errors by code
var err = cne; console;// true console;// true console; // certificate console;// The server responded with a certificate that is signed by an authority// we don't trust. The could mean://// 1. An attacker has substituted the real certificate for a cert that// contains his public key and is signed by his cousin.//// 2. The server operator has a legitimate certificate from a CA we don't// know about, but should trust.//// 3. The server is presenting a self-signed certificate, providing no// defense against active attackers (but foiling passive attackers).
License
MIT