]> khamidou — GitHub mirrors - electron.git/commitdiff
Improve error message dont-crash-when-missing-ipc-channel
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 9 Feb 2016 18:34:50 +0000 (10:34 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Tue, 9 Feb 2016 18:34:50 +0000 (10:34 -0800)
atom/browser/api/lib/web-contents.js
spec/api-browser-window-spec.js

index 8dde10df4d19eebeb4bb7a903fdf7429ec3bee39..e0c16999c72abe8285977090e013790babed945c 100644 (file)
@@ -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));
   };
index cb041a9320d876e1757b9104907cc5ed07b8547e..d59eb9a8baa4dd7bf9b1d2c0de5b2d0dfe6c9e85 100644 (file)
@@ -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');
     });
   });
 });