$$passToExceptionHandler in AngularJS not throwing exception

Viewed 339

I'm using AngularJS version of 1.7.2 and got an exception with this message

Cannot read property 'dataItem' of undefined

and it is not throwing into console / customExceptionHandling Service Because code in AngularJS is below:

catch (e) {
    rejectPromise(promise, e);
    // This error is explicitly marked for being passed to the $exceptionHandler 
    if (e && e.$$passToExceptionHandler === true) {     
        exceptionHandler(e); 
    }
}

that $$passToExceptionHandler is not present in e object and exceptionHandler function is not calling.

Can anyone please explain to me why this is happening?

2 Answers

You might have disabled reporting unhandled rejected promises with this line:

qProvider.errorOnUnhandledRejections(false);

But generally more information about the error source are required to give you better answer.

Maybe this will work, set $$passToExceptionHandler to all "Error" instance like:

Error.prototype.$$passToExceptionHandler = true
Related