From: Kevin Sawicki Date: Tue, 9 Feb 2016 21:51:35 +0000 (-0800) Subject: Expand error message X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c3f3fc81bfe3e953bcce4751dc062357cf7e57b4;p=electron.git Expand error message --- diff --git a/atom/renderer/lib/web-view/web-view.js b/atom/renderer/lib/web-view/web-view.js index 49440527..9cc6ac4e 100644 --- a/atom/renderer/lib/web-view/web-view.js +++ b/atom/renderer/lib/web-view/web-view.js @@ -409,7 +409,7 @@ var registerWebViewElement = function() { if (internal.webContents) { return internal.webContents[m].apply(internal.webContents, args); } else { - throw new Error(`Cannot call ${m} before the dom-ready event is emitted`); + throw new Error(`Cannot call ${m} because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.`); } }; }; diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 072a51f3..0b6572a5 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -570,7 +570,7 @@ describe(' tag', function() { readyError = error; } - assert.equal(readyError.message, 'Cannot call stop before the dom-ready event is emitted'); + assert.equal(readyError.message, 'Cannot call stop because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.'); }); });