In Javascript using try / catch, besides the error message how can I catch function name and all arguments names/values passed?
<p>I'd like to create a <strong>generic</strong> debugging routine using try / catch, within the catch segment I'd like a piece of code which will log the function name and all params passed (name => value). </p>

<p>Is this possible?</p>

<pre><code>try{
    // code
} catch(e) {
    var function_name = ''; // how can I get this?
    var function_params = ''; // how can I get this?
    var errorText = 'UNEXPECTED ERROR: \n\n Error Details: '+e.toString();
    errorText = errorText+' Called:'+function_name+'('+function_params+')';
}
</code></pre>
