We have a Angular2 application in which we are using some third party controls in it i.e. IgniteUI/Infragistics IgGrid and PivotGrid controls. The global exception handling for the application is handled like below.
export class CustomErrorHandler implements ErrorHandler {
constructor(private _SessionService: SessionService)
{
}
handleError(error) {
console.log("Error occurred. " + error);
console.log("Stack Trace : " + error.stack);
}
}
All the exceptions/errors thrown in the application are caught in the above mentioned error handler. But for some specific scenario when there is some issue in the data and it is bound with the PivotGrid it crashes the entire application. The exception is being caught in the global error handler inside the handleError() event but after that event the entire application blows-up and it becomes not usable by the user. The exception is thrown inside the PivotGrid while databinding.
Any ideas how do I handle this scenario?
The exception which is thrown inside the pivotgrid and causes the application to blow-up is as below:-
TypeError: Cannot read property 'levelUniqueName' of null
at map (http://localhost:49928/js/IgniteUI/infragistics.lob.js:661:10848)
at e.(anonymous function).(anonymous function)._createTableView (http://localhost:49928/js/IgniteUI/infragistics.lob.js:661:11006)
at e.(anonymous function).(anonymous function)._createTableView (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:7983)
at e.(anonymous function).(anonymous function)._onGridUpdated (http://localhost:49928/js/IgniteUI/infragistics.lob.js:661:26726)
at e.(anonymous function).(anonymous function)._onGridUpdated (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:7983)
at Class.<anonymous> (http://localhost:49928/js/IgniteUI/infragistics.lob.js:661:9410)
at Class.dispatch (http://code.jquery.com/jquery-1.11.3.min.js:4:8549)
at Class.r.handle (http://code.jquery.com/jquery-1.11.3.min.js:4:5252)
at Object.trigger (http://code.jquery.com/jquery-1.11.3.min.js:4:7650)
at Class.<anonymous> (http://code.jquery.com/jquery-1.11.3.min.js:4:15517)