Handling uncaught exceptions in AngularJS