Bug 1119719 - onError function added in urlbarBindings.xml for the search addEngine callback. r=gavin
authorshreyas <shreyas@gmail.com>
Wed, 28 Jan 2015 00:05:54 -0800
changeset 239449 dfe5d424d672924f28b530c7c777b7811be1f78e
parent 239448 10bc2f59111b4cfbab4d37f9815d2bff4f14668e
child 239450 6da36c873c4d5621df4aaf415cc89caae141b342
push id497
push usermleibovic@mozilla.com
push dateWed, 28 Jan 2015 16:43:37 +0000
reviewersgavin
bugs1119719
milestone38.0a1
Bug 1119719 - onError function added in urlbarBindings.xml for the search addEngine callback. r=gavin
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1263,16 +1263,19 @@
       <handler event="command"><![CDATA[
         let target = event.originalTarget;
         if (target.classList.contains("addengine-item")) {
           // On success, hide and reshow the panel to show the new engine.
           let installCallback = {
             onSuccess: function(engine) {
               event.target.hidePopup();
               BrowserSearch.searchBar.openSuggestionsPanel();
+            },
+            onError: function(errorCode) {
+              Components.utils.reportError("Error adding search engine: " + errorCode);
             }
           }
           Services.search.addEngine(target.getAttribute("uri"),
                                     Ci.nsISearchEngine.DATA_XML,
                                     target.getAttribute("image"), false,
                                     installCallback);
         }
       ]]></handler>