Monday, May 05, 2014

Errorception with angularjs

Easy and simple fix to use errorception with anguljar js.

Just add this code to handle error in angularjs.
app.factory('$exceptionHandler', function ($log) {
return function (exception, cause) {
exception.message += ' (caused by "' + cause + '")';
$log.error(exception);
throw exception;
};
});