diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2013-10-18 04:54:26 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2013-10-18 04:54:26 +0400 |
commit | 77854c4f382530156c0f256c8e3732ce6dcbd97a (patch) | |
tree | 0596f8c2a9d92f92a87deba47fa6d2ac3726ecdc /tests/resources | |
parent | 488d7131506f47c273dd721b1a793f9ee55c1cd9 (diff) |
Output trace on webpage error in phantomjs capture script and output diffviewer.html even if phantomjs script fails.
Diffstat (limited to 'tests/resources')
-rw-r--r-- | tests/resources/screenshot-capture/capture.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/resources/screenshot-capture/capture.js b/tests/resources/screenshot-capture/capture.js index 84de3a3bbd..2231628332 100644 --- a/tests/resources/screenshot-capture/capture.js +++ b/tests/resources/screenshot-capture/capture.js @@ -93,8 +93,15 @@ PageRenderer.prototype = { _setupWebpageEvents: function () { var self = this; - this.webpage.onError = function (message) { - console.log("Webpage error: " + message); + this.webpage.onError = function (message, trace) { + var msgStack = ['Webpage error: ' + msg]; + if (trace && trace.length) { + msgStack.push('trace:'); + trace.forEach(function(t) { + msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : '')); + }); + } + console.log(msgStack.join('\n')); }; this.webpage.onConsoleMessage = function (message) { |