From 87431d5a9731a781c1ba3fb82bc87ffaa1c74913 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 28 Dec 2011 11:57:28 -0500 Subject: [PATCH] Bug 463122 - Improve xpcshell error reporting for generic exceptions caught at the top level. r=ted --- testing/xpcshell/head.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index 9495202486c..ac7bbcb5577 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -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);