From bbd1da60e384a87a1119b77c43a66c6fda4eee64 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 5 Oct 2010 19:33:08 +0000 Subject: [PATCH] be quiet with errors retrieving remote column settings git-svn-id: svn://svn.open-ils.org/ILS/trunk@18180 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/list.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 739a244273..dc1570a841 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -305,12 +305,20 @@ util.list.prototype = { } /* local file will trump remote file if allowed, so save ourselves an http request if this is the case */ if (obj.data.hash.aous['url.remote_column_settings'] && ! my_cols ) { - var x = new XMLHttpRequest(); - var url = obj.data.hash.aous['url.remote_column_settings'] + '/tree_columns_for_' + window.escape(id); - x.open("GET", url, false); - x.send(null); - if (x.status == 200) { - my_cols = JSON2js( x.responseText ); + try { + var x = new XMLHttpRequest(); + var url = obj.data.hash.aous['url.remote_column_settings'] + '/tree_columns_for_' + window.escape(id); + x.open("GET", url, false); + x.send(null); + if (x.status == 200) { + my_cols = JSON2js( x.responseText ); + } + } catch(E) { + // This can happen in the offline interface if you logged in previously and url.remote_column_settings is set. + // 1) You may be really "offline" now + // 2) the URL may just be a path component without a hostname (ie "/xul/column_settings/"), which won't work + // when appended to chrome://open_ils_staff_client/ + dump('Error retrieving column settings from ' + url + ': ' + E + '\n'); } } -- 2.11.0