Handle session timeout in Scheduler .NET

We’re using Scheduler .NET in MVC 5. How do we capture session timeout in an ajax call? We know that when the session expires MVC captures the error and returns ok (status 200) and tries to redirect the user to the login page but we have resolved that issue so that no redirect is performed. Still we cannot capture the 401 unauthorized error in the scheduler. We have tried:

dhtmlxError.catchError("ALL", function (type, desc, erData) {
            alert('ajax error');

But the error is not caught. Instead we get a javascript error because data is empty. What can we do instead?

the 401 that are triggered by the dataprocessor (update/delete/insert requests) can be captured with following code:

dhtmlxError.catchError("LoadXML", function (type, desc, erData) { alert('ajax error'); });
However, it seems like that json loading (which is used in Scheduler.NET by default) does not raises any api event in that case. I’ll check what can be done and give the update

regarding the errors during the json loading, the current version provides no way for handling them. We’ll add an API event for that in the next version of the component. The update is planned in about three weeks