Improve error message

This commit is contained in:
Kevin Sawicki 2016-02-09 10:34:50 -08:00
parent 3e399d09d7
commit 704bd4d191
2 changed files with 3 additions and 3 deletions

View file

@ -79,7 +79,7 @@ let wrapWebContents = function(webContents) {
var args = 2 <= arguments.length ? slice.call(arguments, 1) : []; var args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
var channel = arguments[0]; var channel = arguments[0];
if (channel == null) { if (channel == null) {
throw new Error('channel must be specified'); throw new Error('Missing required channel argument');
} }
return this._send(channel, slice.call(args)); return this._send(channel, slice.call(args));
}; };

View file

@ -663,11 +663,11 @@ describe('browser-window module', function() {
it('throws an error when the channel is missing', function() { it('throws an error when the channel is missing', function() {
assert.throws(function() { assert.throws(function() {
w.webContents.send(); w.webContents.send();
}, 'channel must be specified'); }, 'Missing required channel argument');
assert.throws(function() { assert.throws(function() {
w.webContents.send(null); w.webContents.send(null);
}, 'channel must be specified'); }, 'Missing required channel argument');
}); });
}); });
}); });