Is there a way to add try-catch to every function in Javascript?
===

For error reporting, I would like to insert a try-catch wrapper around the code of every function I have.

So basically I want to replace 

    function foo(arg){
       bar();
    }

...with...

    function foo(arg){
        try {
            bar() 
        }
        catch(e){
            customErrorHandler(e)
        }
    }

Is there a way to apply this generic try-catch thing to all functions without manually editing all of them? For example by modifying the prototype of the Function object?