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
--- 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);