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
How to not show a fatal error
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: How to not show a fatal error
Failures can be handled at two levels
Firstly, you can set the Handled parameter of the Failed event to True
Additionally, you can handle all failures globally using the #sys_web.RequestFailed event
Provided that one of these events sets Handled to True, the application will keep running
Regards
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
EndroutineCode: Select all
Evtroutine Handling(#Sys_Web.RequestFailed) Reason(#Reason) Handled(#Handled) Request(#Request)
#Handled := True
* Your global error handling
EndroutineRegards
-
Taku Izumi
- Posts: 70
- Joined: Thu Dec 15, 2016 2:03 pm
Re: How to not show a fatal error
I was able to handle a failures using two ways.
Thanks,
Taku
Thanks,
Taku
Re: How to not show a fatal error
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.
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.