Closed
Bug 1215502
Opened 9 years ago
Closed 9 years ago
TypeError: 'toString' called on an object that does not implement interface Exception
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(firefox45 fixed, firefox46 fixed)
VERIFIED
FIXED
mozilla46
People
(Reporter: whimboo, Assigned: ato)
References
Details
(Keywords: pi-marionette-server)
Attachments
(2 files)
I can see this exception when I was investigating a test failure in our Firefox ui tests logged as bug 1215499.
The following output is visible in the Gecko log:
MARIONETTE LOG: INFO: TEST-START: c:\jenkins\workspace\release-mozilla-release_functional\venv\Lib\site-packages\firefox_ui_tests\functional\private_browsing\test_about_private_browsing.py:testCheckAboutPrivateBrowsing
1444997539656 Marionette: Element does not have an accessible object*************************
A coding exception was thrown in a Promise rejection callback.
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
Full message: TypeError: 'toString' called on an object that does not implement interface Exception.
Full stack: error.isError@chrome://marionette/content/error.js:104:12
error.isWebDriverError@chrome://marionette/content/error.js:112:10
error.toJSON@chrome://marionette/content/error.js:72:8
Response.prototype.sendError@chrome://marionette/content/command.js:100:16
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:925:21
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:801:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:740:39
*************************
Marionette threw an error: TypeError: 'toString' called on an object that does not implement interface Exception.
error.isError@chrome://marionette/content/error.js:104:12
error.isWebDriverError@chrome://marionette/content/error.js:112:10
error.toJSON@chrome://marionette/content/error.js:72:8
Response.prototype.sendError@chrome://marionette/content/command.js:100:16
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:925:21
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:801:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:740:39
Assignee | ||
Comment 1•9 years ago
|
||
The error.toJSON function has since been removed. Does this still reproduce?
Flags: needinfo?(hskupin)
Reporter | ||
Comment 2•9 years ago
|
||
Yes, still a problem with a Nightly build from Tuesday:
Full message: TypeError: 'toString' called on an object that does not implement interface Exception.
Full stack: error.isError@chrome://marionette/content/error.js:78:12
error.isWebDriverError@chrome://marionette/content/error.js:86:10
Response.prototype.sendError@chrome://marionette/content/command.js:89:12
Flags: needinfo?(hskupin)
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Comment 3•9 years ago
|
||
This is caused by an incomplete test for whether val in error.isError is an XPCOM exception. The correct check would be to do
val instanceof Ci.nsIException
Assignee | ||
Comment 4•9 years ago
|
||
The current test of the `result' property does not always pass for all
types of XPCOM exceptions. A safer test is to do an instance check
against Components.interfaces.nsIException.
This fixes hangs such as the one described in bug 1202576.
r=dburns
Review commit: https://reviewboard.mozilla.org/r/29881/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/29881/
Assignee | ||
Comment 5•9 years ago
|
||
This fixes serialisation of XPCOM exceptions to the client.
Response.sendError was incorrectly serialising the err input variable
instead of the wrapped WebDriverError, we.
r=dburns
Review commit: https://reviewboard.mozilla.org/r/29883/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/29883/
Assignee | ||
Updated•9 years ago
|
Attachment #8705146 -
Flags: review?(dburns)
Assignee | ||
Updated•9 years ago
|
Attachment #8705147 -
Flags: review?(dburns)
Comment 6•9 years ago
|
||
Comment on attachment 8705146 [details]
MozReview Request: Bug 1215502: Perform nsIException instance test for XPCOM exceptions
https://reviewboard.mozilla.org/r/29881/#review26687
Attachment #8705146 -
Flags: review?(dburns) → review+
Updated•9 years ago
|
Attachment #8705147 -
Flags: review?(dburns) → review+
Comment 7•9 years ago
|
||
Comment on attachment 8705147 [details]
MozReview Request: Bug 1215502: Send wrapped WebDriverError to client
https://reviewboard.mozilla.org/r/29883/#review26691
Reporter | ||
Comment 9•9 years ago
|
||
Thanks for the quick fix Andreas! I wonder if a unit test would also be good to have here.
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/26a9634f6ec2
https://hg.mozilla.org/mozilla-central/rev/a9da976060a8
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Reporter | ||
Comment 11•9 years ago
|
||
This looks great! The hang (bug 1202576) is fixed which was caused by this bug.
David, can we please get this backported to the aurora branch to have it included in the next ESR? Thanks.
Updated•9 years ago
|
Flags: needinfo?(dburns)
Whiteboard: [checkin-needed-aurora]
Comment 12•9 years ago
|
||
bugherder uplift |
Updated•9 years ago
|
Whiteboard: [checkin-needed-aurora]
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•