$exceptionHandler
Description
$exceptionHandler is the central hook for uncaught exceptions inside an AngularTS application.
The framework routes all errors from synchronous code, async tasks, expression evaluation, and dependency injection through this service.
By default, it rethrows exceptions that occur during AngularTS-managed execution. This fail-fast behavior ensures errors are visible immediately in development and in unit tests.
IMPORTANT: In AngularJS, $exceptionHandler only caught errors in expressions and
logged them to the console, using a type signature of $exceptionHandler(exception, [cause]).
AngularTS treats $exceptionHandler as a single error sink, fails eagerly, and assumes that the Error object or one of its subclasses provides all the context necessary for the client.
For type description, see ng.ExceptionHandler.
For service customisation, see ng.ExceptionHandlerProvider
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.