title: Javascript : How to log function parameter at exception time
body: <p>I have a few function in my application in javascript</p>
  <pre><code>function( param1, param2 )
  {
  
  }
  </code></pre>
  <p>Sometimes I have caught exception and sometimes uncaught exception</p>
  <p>My question is that: Is it possible to log out the parameters at the time of exception <strong>without explicitly</strong> writing error handling code in each function?</p>
  <pre><code>function(param1, param2)
  {
  try { /* Big try block contains all code */  } catch(e) { logger.log( param1 , param2) }
  }
  </code></pre>
  <p>If there is anything like hooking in exceptions and print out the original parameter, that would be great !</p>