Is there any way to get the original error thrown by the evaluated code? I have a simple benchmark suite similar to the one bellow, nothing special.
var suite = new Benchmark.Suite;
...
suite.add('Collection Add', function () {
collection.add(someArguments);
})
.on('cycle', function (event) {
console.log(String(event.target));
})
.on('error', function (event) {
console.log(event);
})
.run({'async': true});
The function that is benchmarked trows an error when it receives improper arguments. While setting up the benchmark this happens quite often.
My issue is that, instead of getting the exception raised by the benchmarked code, I get some other error which leaves me with no clue of why the tested code fails. I could try to run it once before the suite, just to check for thrown errors, however I find this to be a time consuming inconvenience.
error: ReferenceError: collection is not defined at Benchmark.define.amd.uid14507863...