Bug 1245153 - Wrap errors before they are passed through the IPC channel; r=automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Wed, 03 Feb 2016 18:44:55 +0000
changeset 332770 a94ae7fff63530a4cc4d1875bb4894657834ecb0
parent 332769 4aad87845982cc81fec375ae9f63223a58003aec
child 332771 6094b11b4325b279dc40b844df327d61a9b90ca6
push id11232
push useratolfsen@mozilla.com
push dateSun, 21 Feb 2016 12:02:10 +0000
reviewersautomatedtester
bugs1245153
milestone47.0a1
Bug 1245153 - Wrap errors before they are passed through the IPC channel; r=automatedtester error.wrap acts as a no-op if it is passed a prototype which is already of the WebDriverError prototypal chain. MozReview-Commit-ID: Gd9kUEvsgNv
testing/marionette/proxy.js
--- a/testing/marionette/proxy.js
+++ b/testing/marionette/proxy.js
@@ -166,17 +166,18 @@ proxy.AsyncMessageChannel = class {
    */
   reply(uuid, obj = undefined) {
     // TODO(ato): Eventually the uuid will be hidden in the dispatcher
     // in listener, and passing it explicitly to this function will be
     // unnecessary.
     if (typeof obj == "undefined") {
       this.sendReply_(uuid, proxy.AsyncMessageChannel.ReplyType.Ok);
     } else if (error.isError(obj)) {
-      let serr = error.toJson(obj);
+      let err = error.wrap(obj);
+      let serr = error.toJson(err);
       this.sendReply_(uuid, proxy.AsyncMessageChannel.ReplyType.Error, serr);
     } else {
       this.sendReply_(uuid, proxy.AsyncMessageChannel.ReplyType.Value, obj);
     }
   }
 
   sendReply_(uuid, type, data = undefined) {
     let path = proxy.AsyncMessageChannel.makePath(uuid);