$exceptionHandlerProvider
Configuration provider for
$exceptionHandler service.Description
Instance of ng.ExceptionHandlerProvider for
configuring the $exceptionHandler service.
The default implementation returns ng.ExceptionHandler function, which simply rethrows the exception.
NOTE: custom implementations should always rethrow the error as the framework assumes that $exceptionHandler always does the throwing.
Properties
$exceptionHandler.handler
Customize the exceptionHandler function.
- Type: ng.ExceptionHandler
- Default: Function that rethrows the exception.
- Example:
angular.module('demo', []) .config([ "$exceptionHandlerProvider", /** @param {ng.ExceptionHandlerProvider} $exceptionHandlerProvider */ ($exceptionHandlerProvider) => { exceptionHandlerProvider.handler = (error) => { myLogger.capture(error); // Rethrow to preserve fail-fast behavior: throw error; }; } ]);
For service description, see $exceptionHandler.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.