News for hackers. Stuff that matters.
Re:You should be using Google Analytics to log your startup'... by DavidPP on Thursday April 05, 2012 @10:55AM (#3802784)
Thanks you took up on my comment and expanded this to a blog post! Where I work, we use try/catch block but they do have their drawbacks (one of them is less optimization in Chrome).
Re:You should be using Google Analytics to log your startup'... by dclaysmith on Thursday April 05, 2012 @10:58AM (#3802801)
Very clever idea (added a link to your twitter/tumblr). Do you use try/catch in each method or a single wrapper of some sort?
Re:You should be using Google Analytics to log your startup'... by rakeshpai on Thursday April 05, 2012 @11:18AM (#3802915)
It isn't possible to have a single "wrapper" try/catch in JS, because of the event-loop nature of most JS hosts. This is because functions that are scheduled to run on the event loop (say, using a button click, or a ajax call), aren't in the same call-stack as the code that defined it. Since they aren't in the same call-stack, an outer try/catch won't work on the inner callback.
Re:You should be using Google Analytics to log your startup'... by DavidPP on Thursday April 05, 2012 @11:04AM (#3802839)
Well, in our case we work with multiples development teams, so we only "catching" errors in our code so we don't use a wrapper. If someone try it this way, I would be curious to hear about the results.