angular.js/src/service/exceptionHandler.js

25 lines
617 B
JavaScript
Raw Normal View History

'use strict';
/**
* @ngdoc service
* @name angular.service.$exceptionHandler
* @requires $log
*
* @description
* Any uncaught exception in angular expressions is delegated to this service.
* The default implementation simply delegates to `$log.error` which logs it into
* the browser console.
*
* In unit tests, if `angular-mocks.js` is loaded, this service is overriden by
* {@link angular.module.NG_MOCK.$exceptionHandler mock $exceptionHandler}
*
* @example
*/
function $ExceptionHandlerProvider(){
this.$get = ['$log', function($log){
return function(e) {
$log.error(e);
};
}];
}