From: Kevin Sawicki Date: Tue, 9 Feb 2016 18:34:50 +0000 (-0800) Subject: Improve error message X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=refs%2Fheads%2Fdont-crash-when-missing-ipc-channel;p=electron.git Improve error message --- diff --git a/atom/browser/api/lib/web-contents.js b/atom/browser/api/lib/web-contents.js index 8dde10df..e0c16999 100644 --- a/atom/browser/api/lib/web-contents.js +++ b/atom/browser/api/lib/web-contents.js @@ -79,7 +79,7 @@ let wrapWebContents = function(webContents) { var args = 2 <= arguments.length ? slice.call(arguments, 1) : []; var channel = arguments[0]; if (channel == null) { - throw new Error('channel must be specified'); + throw new Error('Missing required channel argument'); } return this._send(channel, slice.call(args)); }; diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index cb041a93..d59eb9a8 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -663,11 +663,11 @@ describe('browser-window module', function() { it('throws an error when the channel is missing', function() { assert.throws(function() { w.webContents.send(); - }, 'channel must be specified'); + }, 'Missing required channel argument'); assert.throws(function() { w.webContents.send(null); - }, 'channel must be specified'); + }, 'Missing required channel argument'); }); }); });