[Pkg-mozext-commits] [requestpolicy] 24/100: handle error loading libraries

David Prévot taffit at moszumanska.debian.org
Fri Dec 12 22:56:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 66f69870d2ac292be8b427b48bd60bc3f0215a3c
Author: myrdd <myrdd at users.noreply.github.com>
Date:   Tue Sep 16 14:44:07 2014 +0200

    handle error loading libraries
    
    (loading the libraries normally never happens)
---
 src/components/requestpolicyService.js | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/components/requestpolicyService.js b/src/components/requestpolicyService.js
index f465fe9..3e63be5 100644
--- a/src/components/requestpolicyService.js
+++ b/src/components/requestpolicyService.js
@@ -162,19 +162,24 @@ RequestPolicyService.prototype = {
     try {
       this._loadLibraries();
 
-      this._rejectedRequests = new requestpolicy.mod.RequestSet();
-      this._allowedRequests = new requestpolicy.mod.RequestSet();
-
-      this._initContentPolicy();
-      this._register();
-      this._initializePrefSystem();
-      this._initializePrivateBrowsing();
-      // Note that we don't load user preferences at this point because the user
-      // preferences may not be ready. If we tried right now, we may get the
-      // default preferences.
-    } catch (e) {
-      requestpolicy.mod.Logger.severe(requestpolicy.mod.Logger.TYPE_POLICY,
-          "exception from _init(): " + e);
+      try {
+        this._rejectedRequests = new requestpolicy.mod.RequestSet();
+        this._allowedRequests = new requestpolicy.mod.RequestSet();
+
+        this._initContentPolicy();
+        this._register();
+        this._initializePrefSystem();
+        this._initializePrivateBrowsing();
+        // Note that we don't load user preferences at this point because the user
+        // preferences may not be ready. If we tried right now, we may get the
+        // default preferences.
+      } catch (e) {
+        requestpolicy.mod.Logger.severe(requestpolicy.mod.Logger.TYPE_POLICY,
+            "exception from _init(): " + e);
+      }
+    } catch(e) {
+      // in case the libraries could not be loaded, the Logger is not available
+      dump("[RequestPolicy] [SEVERE] [POLICY] exception from _init(): " + e + "\n");
     }
   },
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list