Bug 1106913 - Send errors from sendResponse/sendError back to chrome. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Fri, 24 Nov 2017 18:19:18 +0000
changeset 705705 be6fc3b4c73fa527722bcef517361d3e1469be40
parent 705606 ba283baf4e98aa3a5f45a17981077b98697aa73a
child 705706 51ac14899f3d2352e95def6dc2237d6719f1a979
push id91554
push userbmo:ato@sny.no
push dateThu, 30 Nov 2017 15:13:32 +0000
reviewerswhimboo
bugs1106913
milestone59.0a1
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
testing/marionette/listener.js
--- 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);