Page 1 of 1

How to not show a fatal error

Posted: Wed Sep 20, 2017 7:52 am
by Taku Izumi
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

Re: How to not show a fatal error

Posted: Wed Sep 20, 2017 8:39 am
by Stewart Marshall
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

Re: How to not show a fatal error

Posted: Wed Sep 20, 2017 4:24 pm
by Taku Izumi
I was able to handle a failures using two ways.

Thanks,
Taku

Re: How to not show a fatal error

Posted: Wed Sep 20, 2017 5:30 pm
by MarkD
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.