I've built a javascript function that merges multiple ajax functions into a single request. With each request, there is almost always a callback function. The bundled function calls the callback functions one at a time.
I've surrounded these with a try catch to prevent one function from preventing the other functions from running. However, I would still like the browser to notify me about javascript errors. How can I do this?
I've set an example of what I'm trying to do up here.
The code from the jsfiddle link above:
<script>
function doSomeStuff() {
for (var i in arguments) {
try {
arguments[i].apply(this);
}
catch (e) {
throw e;
}
}
}
doSomeStuff(function() { console.log("i'm an apple"); },
function() { imnotavariable = test; },
function() { console.log("i'm an apple too"); });
</script>
Summary of Question: How do I catch an error, while still reporting it to the browser?