From bd97257b35172e92f347777910d5a14c0de32528 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 20 Sep 2005 18:04:06 +0000 Subject: [PATCH] auth exceptions git-svn-id: svn://svn.open-ils.org/ILS/trunk@1837 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/evergreen/auth/auth.js | 11 +++++++---- .../chrome/content/evergreen/util/error.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js b/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js index 0b5f48fa46..3f7a5247d5 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js +++ b/Evergreen/staff_client/chrome/content/evergreen/auth/auth.js @@ -2,6 +2,7 @@ var G = {}; // the master Global variable var debug_ignore_auth_failures = false; +G.offline = false; G['main_window'] = self; G['win_list'] = []; G['appshell_list'] = []; @@ -116,10 +117,9 @@ function auth_init_callback(request) { auth_init = request.getResultObject(); if (!auth_init) { throw('null result'); } } catch(E) { - alert('Login failed on auth_init: ' + js2JSON(E)); - if (!debug_ignore_auth_failures) { - enable_login_prompts(); return; - } + G.offline = true; + sdump('D_ERROR','Error trying to communicate with the server. Entering OFFLINE mode.\n'); + s_alert('Error trying to communicate with the server. Entering OFFLINE mode.\n'); } sdump( 'D_AUTH', 'D_AUTH_INIT: ' + typeof(auth_init) + ' : ' + auth_init + '\n'); @@ -142,6 +142,9 @@ function auth_ses_callback(request) { auth_ses = request.getResultObject(); if (!auth_ses) { throw('null result'); } if (auth_ses == 0) { throw('0 result'); } + if (instanceOf(auth_ses,ex)) { + throw(auth_ses.err_msg()); + } } catch(E) { alert('Login failed on auth_ses: ' + js2JSON(E)); if (!debug_ignore_auth_failures) { diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/error.js b/Evergreen/staff_client/chrome/content/evergreen/util/error.js index f74423eb28..b3d08aa130 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/util/error.js +++ b/Evergreen/staff_client/chrome/content/evergreen/util/error.js @@ -26,7 +26,7 @@ var sdump_levels = { 'D_HTML_TABLE' : false, 'D_TAB' : false, - 'D_AUTH' : false, + 'D_AUTH' : true, 'D_OPAC' : true, -- 2.43.2