aboutsummaryrefslogtreecommitdiff
path: root/src/enzymatic.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-09-04 14:26:31 -0700
committeralon@honor <none@none>2010-09-04 14:26:31 -0700
commita21a2fcf89e3f19ff004b0656c4737f999e1563a (patch)
treeeef19455c426fc8c60be56946e83334b759edeaf /src/enzymatic.js
parent03f2bdb99ecbd69698622fec859b883ff57d02b8 (diff)
cleanup for mathops, function and error reporting
Diffstat (limited to 'src/enzymatic.js')
-rw-r--r--src/enzymatic.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/enzymatic.js b/src/enzymatic.js
index 419cc73e..ae677829 100644
--- a/src/enzymatic.js
+++ b/src/enzymatic.js
@@ -150,13 +150,25 @@ Zyme.prototype = {
},
process: function(items) {
var ret = [];
- items.forEach(function(item) { ret = ret.concat(this.processItem(item)) }, this);
+ items.forEach(function(item) {
+ try {
+ ret = ret.concat(this.processItem(item));
+ } catch (e) {
+ print("Exception in process(), current item is: " + dump(item));
+ throw e;
+ }
+ }, this);
return ret;
},
processPairs: function(items, func) {
var ret = [];
for (var i = 0; i < items.length; i += 2) {
- ret = ret.concat(func(items[i], items[i+1]));
+ try {
+ ret = ret.concat(func(items[i], items[i+1]));
+ } catch (e) {
+ print("Exception in processPairs(), current items are: " + dump(items[i]) + ' :::: ' + dump(items[i+1]));
+ throw e;
+ }
}
return ret;
},