Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[$rootScope:inprog] null already in progress
function exceptionHandler(){
const error = Error;
const nullMessage = "[$rootScope:inprog] null already in progress";
function exception(message){
if(message.indexOf(nullMessage) === 0){
const $rootScope = exceptionHandler.$rootScope;
if($rootScope) $rootScope.$$phase = null;
const exception = new error(nullMessage);
exception.stack = "";
return exception;
return new error(message);
Error = exception;
exceptionHandler(); // If it's not run AngularJS will use the original Error constructor, the one we're decorating["$rootScope", function($rootScope){
exceptionHandler.$rootScope = $rootScope;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment