node-phantom icon indicating copy to clipboard operation
node-phantom copied to clipboard

pageOnError suppress errors

Open loretoparisi opened this issue 9 years ago • 0 comments

It seems it does not override the default pageOneError

page.onError = function(msg, trace) {
                var msgStack = ['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 + '")' : ''));
                    });
                }
                // uncomment to log into the console
                // console.error(msgStack.join('\n'));
            };

loretoparisi avatar Jun 23 '15 17:06 loretoparisi