How to not show a fatal error

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Taku Izumi
Posts: 16
Joined: Thu Dec 15, 2016 2:03 pm

How to not show a fatal error

Post by Taku Izumi » Wed Sep 20, 2017 7:52 am

Hi,

When a server module request fails, a fatal error message shows in a web browser.

Is it possible to continue to display VL Web application screen without showing the fatal error?

Best regards,
Taku

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: How to not show a fatal error

Post by Stewart Marshall » Wed Sep 20, 2017 8:39 am

Failures can be handled at two levels

Firstly, you can set the Handled parameter of the Failed event to True

Code: Select all

Mthroutine Name(GetData)
 
   Define_Com Class(#MyServerModule.GetData) Name(#GetData)
 
   #GetData.ExecuteAsync
 
   Evtroutine Handling(#GetData.Completed)
 
      * Update UI with data
 
   Endroutine
 
   Evtroutine Handling(#GetData.Failed) Handled(#Handled)
   
   	#Handled := True
 	* Your local error handling
 	
   Endroutine
   
Endroutine
Additionally, you can handle all failures globally using the #sys_web.RequestFailed event

Code: Select all

Evtroutine Handling(#Sys_Web.RequestFailed) Reason(#Reason) Handled(#Handled) Request(#Request)
 
   #Handled := True
   * Your global error handling
 
Endroutine
Provided that one of these events sets Handled to True, the application will keep running

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Taku Izumi
Posts: 16
Joined: Thu Dec 15, 2016 2:03 pm

Re: How to not show a fatal error

Post by Taku Izumi » Wed Sep 20, 2017 4:24 pm

I was able to handle a failures using two ways.

Thanks,
Taku

MarkD
Posts: 620
Joined: Wed Dec 02, 2015 9:56 am

Re: How to not show a fatal error

Post by MarkD » Wed Sep 20, 2017 5:30 pm

If your server modules are using

Begin_Com Role(*EXTENDS #PRIM_SRVM) Sessionidentifier(<some identifier>)

where you do a #Com_Owner.Session to get the session started.

If a server module within that session fails, then generally you lose your current session and its state.

Any attempts to run more server modules within that session will fail.

You need to start a new session.

Post Reply