[open-ils-commits] r11957 - in trunk/Open-ILS/xul/staff_client: chrome/content/OpenILS server/main
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jan 25 19:38:51 EST 2009
Author: phasefx
Date: 2009-01-25 19:38:50 -0500 (Sun, 25 Jan 2009)
New Revision: 11957
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/server/main/data.xul
Log:
more graceful handling of errors during login sequence
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-01-26 00:31:32 UTC (rev 11956)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-01-26 00:38:50 UTC (rev 11957)
@@ -778,12 +778,12 @@
this.exec.on_error = function(E) {
if (typeof obj.on_error == 'function') {
- obj.on_error();
+ return obj.on_error(E); /* false breaks chain */
} else {
alert('oops: ' + E );
+ return false; /* break chain */
}
- return false; /* break chain */
}
this.exec.chain( this.chain );
Modified: trunk/Open-ILS/xul/staff_client/server/main/data.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/main/data.xul 2009-01-26 00:31:32 UTC (rev 11956)
+++ trunk/Open-ILS/xul/staff_client/server/main/data.xul 2009-01-26 00:38:50 UTC (rev 11957)
@@ -178,14 +178,33 @@
// ----
+ JSAN.use('util.error');
+ g.error = new util.error();
JSAN.use('OpenILS.data');
g.data = new OpenILS.data()
- g.data.on_error = xulG.auth.logoff;
g.data.session = {};
g.data.session.key = xulG.auth.session.key;
g.data.session.authtime = xulG.auth.session.authtime;
g.data.stash('session');
+ g.data.on_error = function(E) {
+ try {
+ g.error.standard_unexpected_error_alert('Error during login sequence. The client will logout after this dialog.',E);
+ setTimeout(
+ function() {
+ try {
+ xulG.auth.logoff();
+ } catch(E3) {
+ alert(E3);
+ }
+ }, 0
+ );
+ } catch(E2) {
+ alert(E2);
+ try { xulG.auth.logoff(); } catch(E4) { alert(E4); };
+ }
+ return false;
+ }
g.data.on_complete = function () {
try {
More information about the open-ils-commits
mailing list