try/catch, just in case collab/phasefx/custom_js
authorJason Etheridge <jason@esilibrary.com>
Tue, 6 Sep 2011 19:44:56 +0000 (15:44 -0400)
committerJason Etheridge <jason@esilibrary.com>
Tue, 6 Sep 2011 19:44:56 +0000 (15:44 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul

index 41e0570..fdfb446 100644 (file)
         <script type="text/javascript" src="../main/constants.js" />
         <script>
         <![CDATA[
-            if (typeof xulG.url_prefix != 'undefined') {
-                dump('pulling in custom.js in util_overlay_chrome.xul\n');
-                // Pull in local customizations
-                var r = new XMLHttpRequest();
-                r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
-                r.send(null);
-                if (r.status == 200) {
-                    dump('Evaluating /xul/server/skin/custom.js\n');
-                    eval( r.responseText );
+            try {
+                if (typeof xulG.url_prefix != 'undefined') {
+                    dump('pulling in custom.js in util_overlay_chrome.xul\n');
+                    // Pull in local customizations
+                    var r = new XMLHttpRequest();
+                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    r.send(null);
+                    if (r.status == 200) {
+                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        eval( r.responseText );
+                    }
+                } else {
+                    dump('cannot pull in custom.js in util_overlay_chrome.xul\n');
                 }
-            } else {
-                dump('cannot pull in custom.js in util_overlay_chrome.xul\n');
+            } catch(E) {
+                dump('cannot pull in custom.js in util_overlay_chrome.xul: ' + E + '\n');
             }
         ]]>
         </script>
index 08f61c3..207469c 100644 (file)
         <script type="text/javascript" src="../main/constants.js" />
         <script>
         <![CDATA[
-            if (typeof xulG.url_prefix != 'undefined') {
-                dump('pulling in custom.js in util_overlay_offline.xul\n');
-                // Pull in local customizations
-                var r = new XMLHttpRequest();
-                r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
-                r.send(null);
-                if (r.status == 200) {
-                    dump('Evaluating /xul/server/skin/custom.js\n');
-                    eval( r.responseText );
+            try {
+                if (typeof xulG.url_prefix != 'undefined') {
+                    dump('pulling in custom.js in util_overlay_offline.xul\n');
+                    // Pull in local customizations
+                    var r = new XMLHttpRequest();
+                    r.open("GET", xulG.url_prefix('/xul/server/skin/custom.js'), false);
+                    r.send(null);
+                    if (r.status == 200) {
+                        dump('Evaluating /xul/server/skin/custom.js\n');
+                        eval( r.responseText );
+                    }
+                } else {
+                    dump('cannot pull in custom.js in util_overlay_offline.xul\n');
                 }
-            } else {
-                dump('cannot pull in custom.js in util_overlay_offline.xul\n');
+            } catch(E) {
+                dump('cannot pull in custom.js in util_overlay_offline.xul: ' + E + '\n');
             }
         ]]>
         </script>