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
This commit is contained in:
Andreas Tolfsen 2016-02-03 18:44:55 +00:00
parent ecd87e078d
commit 50123c8439

View File

@ -171,7 +171,8 @@ proxy.AsyncMessageChannel = class {
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);