From ba0113f9566e2c2df30a3791d1c7c6a33d9c143a Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 12 Apr 2006 04:52:07 +0000 Subject: [PATCH] better experience with patron retrieve failures git-svn-id: svn://svn.open-ils.org/ILS/trunk@3677 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/patron/barcode_entry.xul | 2 ++ Open-ILS/xul/staff_client/server/patron/display.js | 6 +++--- Open-ILS/xul/staff_client/server/patron/summary.js | 10 ++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul index 30412abecc..96e018d830 100644 --- a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul +++ b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul @@ -71,6 +71,8 @@ try { window.xulG.set_tab_name('Patron Scan'); } catch(E) { alert(E); } } + if (g.cgi.param('error')) { alert(g.cgi.param('error')); } + } catch(E) { var err_msg = "!! This software has encountered an error. Please tell your friendly " + "system administrator or software developer the following:\n" + E + '\n'; diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index e34b8214cc..15b7c3f5ce 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -300,9 +300,9 @@ patron.display.prototype = { } }, 'on_error' : function(E) { - location.href = urls.XUL_PATRON_BARCODE_ENTRY + '?session=' - + window.escape(obj.session); - alert(E); + location.href = urls.XUL_PATRON_BARCODE_ENTRY + + '?session=' + window.escape(obj.session) + + '&error=' + window.escape(E); } } ); diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 3bbcdad454..37a9dd7cbe 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -489,8 +489,7 @@ patron.summary.prototype = { // are we moving toward a payload here? } else { - var error = robj.ilsevent + ' : ' - + obj.error.get_ilsevent( robj.ilsevent ); + var error = obj.error.get_ilsevent( robj.ilsevent ); throw(error); } } else { @@ -503,7 +502,7 @@ patron.summary.prototype = { } } catch(E) { - var error = ('patron.summary.retrieve : ' + js2JSON(E)); + var error = js2JSON(E); obj.error.sdump('D_ERROR',error); throw(error); } @@ -565,8 +564,7 @@ patron.summary.prototype = { var card = new ac(); card.barcode( obj.barcode ); obj.patron.card( card ); obj.patron.family_name( 'Could not retrieve patron' ); - var error = ('FIXME: Need better alert and error handling.\nProblem with barcode: ' - + obj.barcode + '\n' + E); + var error = ('Problem with barcode: ' + obj.barcode + '\n' + E); if (typeof window.xulG == 'object' && typeof window.xulG.on_error == 'function') { obj.error.sdump('D_PATRON_SUMMARY', @@ -580,7 +578,7 @@ patron.summary.prototype = { this.exec.chain( chain ); } catch(E) { - var error = ('patron.summary.retrieve : ' + js2JSON(E)); + var error = (js2JSON(E)); this.error.sdump('D_ERROR',error); if (typeof window.xulG == 'object' && typeof window.xulG.on_error == 'function') { window.xulG.on_error(error); -- 2.43.2