Commit 711d654d 711d654d9e87fc2adbf8ca275add47364647f751 by Nicolas Perriault

better display of uncaught CasperError errors

1 parent f5d21fc3
......@@ -150,7 +150,7 @@ if (!phantom.casperLoaded) {
}
}
// trick to locate source file location on error
scriptCode += ";var __fe__ = new Error('__sourceId__')";
scriptCode += ";var __fe__ = new CasperError('__sourceId__')";
scriptCode += ";__fe__.fileName = '" + file + "'";
scriptCode += ";throw __fe__;";
return scriptCode;
......@@ -166,7 +166,7 @@ if (!phantom.casperLoaded) {
if (typeof callback === "function") {
callback(error, file);
} else {
console.error(this.getErrorMessage(error));
console.error(error.stack);
this.exit(1);
}
};
......
......@@ -320,7 +320,7 @@ var Tester = function(casper, options) {
phantom.processScriptError(e, file, function(error) {
// do not abort the whole suite, just fail fast displaying the
// caught error and process next suite
self.fail(phantom.getErrorMessage(e));
self.fail(e);
self.done();
});
}
......