Override "application InvalidSession" error message

Answered
1
0

If a WiseJ session is running on a device, and a new version is published to the server, the following message pops up, and the session becomes dead:

Invalid session.
at: Wisej.Core.ReponseManager.Process.Request(ServiceType service, Object message)

How can this event be intercepted and overridden? I want to customize the MessageBox text and behavior, so we can reload the app URL.

Tried this in default.html, but it didn’t fire: https://wisej.com/support/question/network-errors-dialogs

 

  • You must to post comments
Best Answer
1
0

Wisej.onNetworkError handles only network problems which are detected on the client: if there is a network problem it cannot be notified by the server.

Wisej.onException handles all exceptions coming from the server for any reason. When the exception is InvalidSession there is an additional property invalidSession. Example:

Wisej.onException = function(ex) {
   if (ex.invalidSession) {
         // reload, this may lead to a never ending reload loop.
        location.reload()
   }
   else {
      Wisej.Core.showException(ex);
   }

}

You can inspect ex to see the other fields: message, exception, stackTrace.

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.