From 32bde11f7c38327bc633653960d5e08f2395a585 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 2 Jan 2006 02:39:06 +0000 Subject: [PATCH] change error handling on chain exec so chain can be broken or not git-svn-id: svn://svn.open-ils.org/ILS/trunk@2577 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/evergreen/OpenILS/data.js | 2 ++ .../chrome/content/evergreen/util/exec.js | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js index 03b897cdf0..74b05be3b4 100644 --- a/Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js @@ -221,6 +221,8 @@ OpenILS.data.prototype = { } else { alert('oops: ' + E ); } + + return false; /* break chain */ } this.exec.chain( this.chain ); diff --git a/Open-ILS/xul/staff_client/chrome/content/evergreen/util/exec.js b/Open-ILS/xul/staff_client/chrome/content/evergreen/util/exec.js index df27897bdb..313afdc22d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/evergreen/util/exec.js +++ b/Open-ILS/xul/staff_client/chrome/content/evergreen/util/exec.js @@ -37,9 +37,21 @@ util.exec.prototype = { args[0](); if (args.length > 1 ) obj.chain( args.slice(1) ); } catch(E) { - dump('util.exec.chain broken: ' + E + '\n'); + dump('util.exec.chain error: ' + js2JSON(E) + '\n'); + var keep_going = false; if (typeof obj.on_error == 'function') { - obj.on_error(E); + keep_going = obj.on_error(E); + } + if (keep_going) { + dump('chain not broken\n'); + try { + if (args.length > 1 ) obj.chain( args.slice(1) ); + + } catch(E) { + dump('another error: ' + js2JSON(E) + '\n'); + } + } else { + dump('chain broken\n'); } } }, 0 -- 2.43.2