From: phasefx Date: Thu, 10 Aug 2006 13:42:42 +0000 (+0000) Subject: better exception handling X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e5ba20bafe646c97f61e4f99cc59589bd41c57cd;p=Evergreen.git better exception handling git-svn-id: svn://svn.open-ils.org/ILS/trunk@5420 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 96e59cf7c7..99b216bda3 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -785,10 +785,9 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) { break; } if (msg) error.yns_alert(msg,'Alert',null,'OK',null,"Check here to confirm this message"); - } - /* ROUTE_ITEM */ - if (check.ilsevent == 7000) { + } else /* ROUTE_ITEM */ if (check.ilsevent == 7000) { + var lib = data.hash.aou[ check.org ]; check.route_to = lib.shortname(); var msg = 'This item is in transit to ' + check.route_to + '.\n'; @@ -836,10 +835,9 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) { alert('FIXME: ' + E + '\n'); } } - } - /* ASSET_COPY_NOT_FOUND */ - if (check.ilsevent == 1502) { + } else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) { + check.route_to = 'CATALOGING'; error.yns_alert( 'The barcode was either mis-scanned or the item needs to be cataloged.', @@ -849,11 +847,13 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print) { null, "Check here to confirm this message" ); - } - /* NETWORK TIMEOUT */ - if (check.ilsevent == -1) { + } else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) { error.standard_network_error_alert('Check In Failed. If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface'); + } else { + + throw(check); + } // case '2': case 2: /* LOST??? */