2

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)  
Krishnan
  • 958
  • 5
  • 21
  • 44
  • i just want to say that i see exactly the same behaviour with different third-party lib. Looks like if an exception is thrown in template function the change detection (zone) dies for some components (not only one which template cause it) and the application become unresponsive. I asked about this issue on ng-conf 2017 several people and were not able to get useful response. Do u see this error in dev and in prod mode? – Julia Passynkova May 09 '17 at 02:51
  • @JuliaPassynkova http://stackoverflow.com/questions/37836172/angular-2-doesnt-update-view-after-exception-is-thrown#answer-43796615 – yurzui May 09 '17 at 05:32
  • @JuliaPassynkova, I am getting this error in both Dev and Testing environments. Not yet tested in prod. – Krishnan May 09 '17 at 13:53
  • this https://github.com/angular/angular/commit/07cef36 commit sounds very promising. I am going to test it. – Julia Passynkova May 09 '17 at 14:08
  • Currently my application is in 2.1.1 version, Please let me know the exact version which I need to migrate? also let me know if there are any breaking changes between these 2 versions? – Krishnan May 09 '17 at 15:12
  • @JuliaPassynkova, I have upgraded to 4.1.1 version, but the issue still exists. even now the entire application breaks-up. what about yours? Is the issue resolved for you? – Krishnan May 12 '17 at 14:57
  • As for the error that is thrown by the igPivotGrid, it is most probably result of a wrong configuration. Do you have a [levelSortDirections](http://www.igniteui.com/help/api/2016.2/ui.igPivotGrid#options:levelSortDirections) option configured? – Martin Pavlov May 15 '17 at 12:55
  • @MartinPavlov, yes I agree that there is some issue in levelsortdirections config, but my question here is why after this exception the entire application blows-up and nothing works after that? none of the links/menus i.e. nothing is working after that. how to solve this issue? – Krishnan May 15 '17 at 15:40

0 Answers0