The example below will overwrite the default $exceptionHandler in order to log uncaught errors to the backend for later inspection by the developers using $log.warn() instead of $log.error().
angular.module('exceptionOverwrite', []).
factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {
return function customExcHandler(excp, cause) {
logErrorsToBackend(excp, cause);
$log.warn(excp, cause);
};
}]);