Bug 1215502: Send wrapped WebDriverError to client
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
--- a/testing/marionette/message.js
+++ b/testing/marionette/message.js
@@ -252,17 +252,17 @@ this.Response = class {
* @throws {Error}
* If the {@code error} is not a WebDriverError, the error is
* propagated.
*/
sendError(err) {
let wd = error.isWebDriverError(err);
let we = wd ? err : new WebDriverError(err.message);
- this.error = error.toJson(err);
+ this.error = error.toJson(we);
this.body = null;
this.send();
// propagate errors that are implementation problems
if (!wd) {
throw err;
}
}