From 3e72d835847f02d9ecdc3b26e93b704ae842766a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 9 Feb 2016 10:34:50 -0800 Subject: [PATCH] Improve error message --- atom/browser/api/lib/web-contents.js | 2 +- spec/api-browser-window-spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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'); }); }); }); -- 2.43.0