$exceptionHandlerProvider
Configure the $exceptionHandler service used for framework and application errors.
$exceptionHandlerProvider configures the function used by $exceptionHandler.
The default handler rethrows the exception, and custom handlers should preserve
that behavior after reporting the error.
Exact signatures live in TypeDoc:
Configure Error Reporting
angular.module("demo", []).config(($exceptionHandlerProvider) => {
$exceptionHandlerProvider.handler = (error) => {
myLogger.capture(error);
throw error;
};
});
Rethrowing matters because the framework assumes $exceptionHandler does not
silently swallow fatal errors.
For service usage, 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.