# `$exceptionHandler` (service in module `ng` )

Improve this doc

## 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 overridden by mock $exceptionHandler which aids in testing.

## Dependencies

- `$log`

## Usage

    $exceptionHandler(exception[, cause]);

### Parameters

- `exception – {Error} –`

  Exception associated with the error.

- `cause(optional) – {string=} –`

  optional information about the context in which the error was thrown.