Bug 1096310 - Show message after project list load error. r=paul
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 18 Nov 2014 15:32:49 -0600
changeset 241524 5fc9191444de0ed7087df8af0f202c0d7d4f6520
parent 241523 53fd178424d05176f35b5f9e37322f68508b04c5
child 241525 962915030d1deb7346dd2053ba8f9ea785972ac4
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs1096310
milestone36.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 1096310 - Show message after project list load error. r=paul
browser/devtools/app-manager/app-projects.js
browser/devtools/webide/content/webide.js
browser/locales/en-US/chrome/browser/devtools/webide.properties
--- a/browser/devtools/app-manager/app-projects.js
+++ b/browser/devtools/app-manager/app-projects.js
@@ -11,24 +11,25 @@ const { indexedDB } = require("sdk/index
  * IndexedDB wrapper that just save project objects
  *
  * The only constraint is that project objects have to have
  * a unique `location` object.
  */
 
 const IDB = {
   _db: null,
+  databaseName: "AppProjects",
 
   open: function () {
     let deferred = promise.defer();
 
-    let request = indexedDB.open("AppProjects", 5);
+    let request = indexedDB.open(IDB.databaseName, 5);
     request.onerror = function(event) {
-      deferred.reject("Unable to open AppProjects indexedDB. " +
-                      "Error code: " + event.target.errorCode);
+      deferred.reject("Unable to open AppProjects indexedDB: " +
+                      this.error.name + " - " + this.error.message );
     };
     request.onupgradeneeded = function(event) {
       let db = event.target.result;
       db.createObjectStore("projects", { keyPath: "location" });
     };
 
     request.onsuccess = function() {
       let db = IDB._db = request.result;
@@ -142,21 +143,20 @@ const IDB = {
     return deferred.promise;
   }
 };
 
 const store = new ObservableObject({ projects:[] });
 
 let loadDeferred = promise.defer();
 
-IDB.open().then(function (projects) {
+loadDeferred.resolve(IDB.open().then(function (projects) {
   store.object.projects = projects;
   AppProjects.emit("ready", store.object.projects);
-  loadDeferred.resolve();
-});
+}));
 
 const AppProjects = {
   load: function() {
     return loadDeferred.promise;
   },
 
   addPackaged: function(folder) {
     let file = FileUtils.File(folder.path);
--- a/browser/devtools/webide/content/webide.js
+++ b/browser/devtools/webide/content/webide.js
@@ -67,16 +67,19 @@ let UI = {
     this.updateCommands();
     this.updateRuntimeList();
 
     this.onfocus = this.onfocus.bind(this);
     window.addEventListener("focus", this.onfocus, true);
 
     AppProjects.load().then(() => {
       this.autoSelectProject();
+    }, e => {
+      console.error(e);
+      this.reportError("error_appProjectsLoadFailed");
     });
 
     // Auto install the ADB Addon Helper and Tools Adapters. Only once.
     // If the user decides to uninstall any of this addon, we won't install it again.
     let autoinstallADBHelper = Services.prefs.getBoolPref("devtools.webide.autoinstallADBHelper");
     let autoinstallFxdtAdapters = Services.prefs.getBoolPref("devtools.webide.autoinstallFxdtAdapters");
     if (autoinstallADBHelper) {
       GetAvailableAddons().then(addons => {
--- a/browser/locales/en-US/chrome/browser/devtools/webide.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/webide.properties
@@ -15,17 +15,17 @@ remote_runtime=Remote Runtime
 remote_runtime_promptTitle=Remote Runtime
 remote_runtime_promptMessage=hostname:port
 
 importPackagedApp_title=Select Directory
 importHostedApp_title=Open Hosted App
 importHostedApp_header=Enter Manifest URL
 
 notification_showTroubleShooting_label=Troubleshooting
-notification_showTroubleShooting_accesskey=t
+notification_showTroubleShooting_accesskey=T
 
 # LOCALIZATION NOTE (project_tab_loading): This is shown as a temporary tab
 # title for browser tab projects when the tab is still loading.
 project_tab_loading=Loading…
 
 # These messages appear in a notification box when an error occur.
 
 error_cantInstallNotFullyConnected=Can't install project. Not fully connected.
@@ -37,16 +37,18 @@ error_operationTimeout=Operation timed o
 error_operationFail=Operation failed: %1$S
 
 # Variable: app name
 error_cantConnectToApp=Can't connect to app: %1$S
 
 # Variable: error message (in english)
 error_cantFetchAddonsJSON=Can't fetch the add-on list: %S
 
+error_appProjectsLoadFailed=Unable to load project list. This can occur if you've used this profile with a newer version of Firefox.
+
 addons_stable=stable
 addons_unstable=unstable
 # LOCALIZATION NOTE (addons_simulator_label): This label is shown as the name of
 # a given simulator version in the "Manage Simulators" pane.  %1$S: Firefox OS
 # version in the simulator, ex. 1.3.  %2$S: Simulator stability label, ex.
 # "stable" or "unstable".
 addons_simulator_label=Firefox OS %1$S Simulator (%2$S)
 addons_install_button=install