Bug 1215502: Send wrapped WebDriverError to client draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 07 Jan 2016 14:41:11 +0000
changeset 319661 59fc6efc6ba20369a06489a49801dfa851c8acb2
parent 319660 51b5babdda942653a00c51468fa81d3ccf6b646b
child 512629 a316b23e6ae199bad71c1b2c28ceb353f2daabed
push id9071
push useratolfsen@mozilla.com
push dateThu, 07 Jan 2016 14:45:05 +0000
bugs1215502
milestone46.0a1
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
testing/marionette/message.js
--- 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;
     }
   }