Bug 883601 - Downgrade exceptions to warning when accessing rawNode on an inspector front. r=paul
authorDave Camp <dcamp@mozilla.com>
Mon, 10 Jun 2013 21:18:43 -0700
changeset 147509 b2db738f75d8cae8cf236479d558e18f6ba4f5b4
parent 147508 25fba7984dc9638c7c9f5d446feac8d5b102a5ed
child 147510 4de2ded917f1aa191be6f1f7f3d8b13834a53b32
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs883601
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 883601 - Downgrade exceptions to warning when accessing rawNode on an inspector front. r=paul
toolkit/devtools/server/actors/inspector.js
--- a/toolkit/devtools/server/actors/inspector.js
+++ b/toolkit/devtools/server/actors/inspector.js
@@ -400,21 +400,24 @@ let NodeFront = protocol.FrontClass(Node
 
   /**
    * Get an nsIDOMNode for the given node front.  This only works locally,
    * and is only intended as a stopgap during the transition to the remote
    * protocol.  If you depend on this you're likely to break soon.
    */
   rawNode: function(rawNode) {
     if (!this.conn._transport._serverConnection) {
-      throw new Error("Tried to use rawNode on a remote connection.");
+      console.warn("Tried to use rawNode on a remote connection.");
+      return null;
     }
     let actor = this.conn._transport._serverConnection.getActor(this.actorID);
     if (!actor) {
-      throw new Error("Could not find client side for actor " + this.actorID);
+      // Can happen if we try to get the raw node for an already-expired
+      // actor.
+      return null;
     }
     return actor.rawNode;
   }
 });
 
 /**
  * Returned from any call that might return a node that isn't connected to root by
  * nodes the child has seen, such as querySelector.
@@ -1586,17 +1589,18 @@ var WalkerFront = exports.WalkerFront = 
   isLocal: function() {
     return !!this.conn._transport._serverConnection;
   },
 
   // XXX hack during transition to remote inspector: get a proper NodeFront
   // for a given local node.  Only works locally.
   frontForRawNode: function(rawNode){
     if (!this.isLocal()) {
-      throw Error("Tried to use frontForRawNode on a remote connection.");
+      console.warn("Tried to use frontForRawNode on a remote connection.");
+      return null;
     }
     let walkerActor = this.conn._transport._serverConnection.getActor(this.actorID);
     if (!walkerActor) {
       throw Error("Could not find client side for actor " + this.actorID);
     }
     let nodeActor = walkerActor._ref(rawNode);
 
     // Pass the node through a read/write pair to create the client side actor.