Bug 1215502 - Send wrapped WebDriverError to client r=automatedtester, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 07 Jan 2016 14:41:11 +0000
changeset 298369 9e810b77b4125da18b69169ec60c44e91189f551
parent 298368 dcd136c18c7ad736e0a8b4a170d08a157e6299a3
child 298370 2af6b79cbbc39bd2a7f77b898eb4eec85b04aeff
push id8926
push usercbook@mozilla.com
push dateFri, 15 Jan 2016 09:02:00 +0000
treeherdermozilla-aurora@9e810b77b412 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1215502
milestone45.0a2
Bug 1215502 - Send wrapped WebDriverError to client r=automatedtester, a=test-only 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;
     }
   }