I don't want $exceptionHandler to handle any exceptions - I want them to propegate up to the browser (primarily for IE testing in Visual Studio).
I'd tried overriding $exceptionHandler and simply rethrowing the error, which gives me the 10 iterations of $digest error (which makes sense).
How do I shut it off completely?
EDIT
Unfortunately rethrowing the error doesn't solve the issue - IE only knows the error from the rethrow and not from source.
According to the documentation, it's possible:
angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {
return function (exception, cause) {
exception.message += ' (caused by "' + cause + '")';
throw exception;
};
});
This example will override the normal action of $exceptionHandler, to make angular exceptions fail hard when they happen, instead of just logging to the console.
After some research, this isn't possible. Angular catches their errors and then calls the exception handler explicitly - in many cases it does not just let the error propagate.
Try throwing the exception inside a window.setTimeout
(not $timeout
) delayed execution, this would allow you to escape the $digest
black hole. But not sure it will preserve the stack-trace in IE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With