diff --git a/src/ng/exceptionHandler.js b/src/ng/exceptionHandler.js index 2adc3f171e03..f30df7918336 100644 --- a/src/ng/exceptionHandler.js +++ b/src/ng/exceptionHandler.js @@ -9,6 +9,20 @@ * 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. + * + * Example override: + * + *
+ * angular.module('exceptionOverride', []).factory('$exceptionHandler', function () { + * return function (exception, cause) { + * exception.message += ' (caused by "' + cause + '")'; + * throw exception; + * }; + * }); + *+ * + * This will make angular exceptions fail hard when they happen instead of just + * complaining to the console. * * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.