X-window Error objects lost logging information when tests fail
Categories
(Testing :: Mochitest, defect)
Tracking
(firefox112 fixed)
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: Gijs, Assigned: Gijs)
References
Details
Attachments
(1 file)
bug 1815682 and bug 1767042 tried to make the logging better for non-Error objects.
Unfortunately, they used instanceof Error
, which only works for error objects from the same scope. When the errors are generated elsewhere, they hit the "object" case, which means we try to JSON.stringify
them, which doesn't work well because the stack/message properties are on the prototype, so the JSON stringification just shows {}
which is... not very useful.
Assignee | ||
Comment 1•2 years ago
|
||
DOM errors have DOMException.isInstance
(which works cross-global), but Error
objects appear not to have this, probably because they're not DOM interfaces? This is annoying though, because it means that AFAICT the best option we have is duck-typing it in some way.
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
bugherder |
Comment 5•2 years ago
|
||
On a (not yet landed) test, I've started getting intermittent errors: [task 2023-03-03T10:29:45.773Z] 10:29:45 INFO - GECKO(1279) | JavaScript error: chrome://mochikit/content/browser-test.js, line 1361: NS_ERROR_XPC_BAD_CONVERT_JS: Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents_Utils.getGlobalForObject]
https://treeherder.mozilla.org/logviewer?job_id=407694387&repo=try&lineNumber=1606
Comment 6•2 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #5)
On a (not yet landed) test, I've started getting intermittent errors:
[task 2023-03-03T10:29:45.773Z] 10:29:45 INFO - GECKO(1279) | JavaScript error: chrome://mochikit/content/browser-test.js, line 1361: NS_ERROR_XPC_BAD_CONVERT_JS: Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents_Utils.getGlobalForObject]
https://treeherder.mozilla.org/logviewer?job_id=407694387&repo=try&lineNumber=1606
It does looks like the fix for bug 1819445 would avoid that.
Assignee | ||
Updated•2 years ago
|
Description
•