Bug 463122 - Improve xpcshell error reporting for generic exceptions caught at the top level. r=ted

This commit is contained in:
Josh Matthews 2011-12-28 11:57:28 -05:00
parent a18ebbe4ab
commit 87431d5a97

View File

@ -334,7 +334,16 @@ function _execute_test() {
// possible that this will mask an NS_ERROR_ABORT that happens after a
// do_check failure though.
if (!_quit || e != Components.results.NS_ERROR_ABORT) {
msg = "TEST-UNEXPECTED-FAIL | (xpcshell/head.js) | " + e;
msg = "TEST-UNEXPECTED-FAIL | ";
if ('fileName' in e) {
msg += e.fileName;
if ('lineNumber' in e) {
msg += ":" + e.lineNumber;
}
} else {
msg += "xpcshell/head.js";
}
msg += " | " + e;
if (e.stack) {
_dump(msg + " - See following stack:\n");
_dump_exception_stack(e.stack);