Bug 1106913 - Send errors from sendResponse/sendError back to chrome. r?whimboo
Errors that arise from inside sendResponse or sendError are currently
only logged to stdout. Now that we have a pretty safe error.wrap
implementation we should serialise them and return them to the main
process so that they are not "lost" in stdout.
MozReview-Commit-ID: FuMeUqQ7CMv
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -22,17 +22,16 @@ Cu.import("chrome://marionette/content/a
Cu.import("chrome://marionette/content/atom.js");
Cu.import("chrome://marionette/content/capture.js");
const {
element,
WebElement,
} = Cu.import("chrome://marionette/content/element.js", {});
const {
ElementNotInteractableError,
- error,
InsecureCertificateError,
InvalidArgumentError,
InvalidElementStateError,
InvalidSelectorError,
NoSuchElementError,
NoSuchFrameError,
pprint,
TimeoutError,
@@ -485,17 +484,17 @@ function dispatch(fn) {
rv = fn.apply(null, args);
} else {
rv = fn(args);
}
resolve(rv);
});
req.then(rv => sendResponse(rv, id), err => sendError(err, id))
- .catch(error.report);
+ .catch(err => sendError(err, id));
};
}
/**
* Add a message listener that's tied to our listenerId.
*/
function addMessageListenerId(messageName, handler) {
addMessageListener(messageName + listenerId, handler);