Bug 1120470 - Handle uncaught promise rejections in protocol.js;r=dcamp
authorEddy Bruël <ejpbruel@gmail.com>
Wed, 14 Jan 2015 07:20:33 +0100
changeset 223678 e5540f8b4a2a42e8cebf6a2ad16cd5e3e5b5b052
parent 223677 a88e871c1dfc375d9afa75b665098addd9f1b81b
child 223679 7d9a5ab12653de4086c77f3758407a4913cae9cc
push id10806
push userejpbruel@mozilla.com
push dateWed, 14 Jan 2015 06:20:50 +0000
treeherderfx-team@e5540f8b4a2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdcamp
bugs1120470
milestone38.0a1
Bug 1120470 - Handle uncaught promise rejections in protocol.js;r=dcamp
toolkit/devtools/server/protocol.js
--- a/toolkit/devtools/server/protocol.js
+++ b/toolkit/devtools/server/protocol.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+let { Cu } = require("chrome");
+let DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
 let Services = require("Services");
 let promise = require("devtools/toolkit/deprecated-sync-thenables");
 let {Class} = require("sdk/core/heritage");
 let {EventTarget} = require("sdk/event/target");
 let events = require("sdk/event/core");
 let object = require("sdk/util/object");
 
 exports.emit = events.emit;
@@ -1143,17 +1145,17 @@ let Front = Class({
    */
   send: function(packet) {
     if (packet.to) {
       this.conn._transport.send(packet);
     } else {
       this.actor().then(actorID => {
         packet.to = actorID;
         this.conn._transport.send(packet);
-      });
+      }).then(null, e => DevToolsUtils.reportException("Front.prototype.send", e));
     }
   },
 
   /**
    * Send a two-way request on the connection.
    */
   request: function(packet) {
     let deferred = promise.defer();