Bug 1506718 - Tolerate exceptions being thrown when getting environment names, r=lsmyth.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 20 Nov 2018 12:00:12 -1000
changeset 506951 3578632557aafbb6ff8564189e0b5a684418d4d6
parent 506950 a847298c2a31439262b757adf26d45e05275a53e
child 506952 795cc577254c0b9b8665c78c6b2a4bdad9cfa5be
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsmyth
bugs1506718
milestone65.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 1506718 - Tolerate exceptions being thrown when getting environment names, r=lsmyth.
devtools/server/actors/replay/replay.js
--- a/devtools/server/actors/replay/replay.js
+++ b/devtools/server/actors/replay/replay.js
@@ -682,22 +682,27 @@ const gRequestHandlers = {
   },
 
   getEnvironmentNames(request) {
     if (!RecordReplayControl.maybeDivergeFromRecording()) {
       return [{name: "Unknown names",
                value: "Recording divergence in getEnvironmentNames" }];
     }
 
-    const env = gPausedObjects.getObject(request.id);
-    const names = env.names();
+    try {
+      const env = gPausedObjects.getObject(request.id);
+      const names = env.names();
 
-    return names.map(name => {
-      return { name, value: convertValue(env.getVariable(name)) };
-    });
+      return names.map(name => {
+        return { name, value: convertValue(env.getVariable(name)) };
+      });
+    } catch (e) {
+      return [{name: "Unknown names",
+               value: "Exception thrown in getEnvironmentNames" }];
+    }
   },
 
   getFrame(request) {
     if (request.index == -1 /* NewestFrameIndex */) {
       const numFrames = countScriptFrames();
       if (!numFrames) {
         // Return an empty object when there are no frames.
         return {};