I would like to capture all server routine failues in a single location. In VL Web, I would put the following event handling routine into my web page, set the #handled := true and process accordingly without having the page crash.
If I put the same code into my copy of UF_OEXEC and cause the server routine to fail, the code in the event handling routine executes.
But then the page proceeds to crash even though I specify #handled := true. The same code works in a standalone VL Web page.
In VLFONE, is there anything else I need to do after setting #handled := true to stop the VLFONE app from crashing?
Regard,
David
VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
-
davidbalansa
- Posts: 92
- Joined: Mon Feb 01, 2016 10:08 am
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Hi David,
You can't handle errors that way in VLF-ONE, because VLF-ONE is already internally listening for #SYS_Web.RequestFailed.
VLF-ONE expects that if you have a scenario where you think failure is likely, you will have coded for it as in shipped example DF_T43H1O. (Example Applications --> Advanced --> Handling Errors)
And if you haven't coded for it, it will shut down.
But even if you do code to handle the error, your session with the server is dead (invalid) from then on, so although the user can continue to do things on the client, the next time they try to interact with the server it will fail anyway because the session is invalid. So the best thing to do when handling the error is to shut down gracefully.
You can't handle errors that way in VLF-ONE, because VLF-ONE is already internally listening for #SYS_Web.RequestFailed.
VLF-ONE expects that if you have a scenario where you think failure is likely, you will have coded for it as in shipped example DF_T43H1O. (Example Applications --> Advanced --> Handling Errors)
And if you haven't coded for it, it will shut down.
But even if you do code to handle the error, your session with the server is dead (invalid) from then on, so although the user can continue to do things on the client, the next time they try to interact with the server it will fail anyway because the session is invalid. So the best thing to do when handling the error is to shut down gracefully.
-
davidbalansa
- Posts: 92
- Joined: Mon Feb 01, 2016 10:08 am
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Hi Mark,
Thank you for the explanation. That makes sense.
One last question. If I do need to handle the error and want to exit gracefully, I see I can use:
#VLF_ONE.uTerminate Possibletocancel(False) Browserisclosing(False)
to display the "You session has ended" message.
Is there a method or technique I can use to send the user back to the login screen?
David
Thank you for the explanation. That makes sense.
One last question. If I do need to handle the error and want to exit gracefully, I see I can use:
#VLF_ONE.uTerminate Possibletocancel(False) Browserisclosing(False)
to display the "You session has ended" message.
Is there a method or technique I can use to send the user back to the login screen?
David
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
It would be better to stay away from the internals in case they change in the future.
You can switch to the exit command just like any other command.
eg: #avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
You can switch to the exit command just like any other command.
eg: #avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Regarding logging on again, #SYS_WEB.URL might be able to be used to navigate to a new tab.
eg:
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
eg:
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
-
davidbalansa
- Posts: 92
- Joined: Mon Feb 01, 2016 10:08 am
Re: VLFONE: Using #SYS_WEB.RequestFailed in UF_OEXEC
Hi Mark,
Thank you for the code example!
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
solves my issue.
Thanks,
David
Thank you for the code example!
#SYS_WEB.Navigate Url(#SYS_WEB.URL) Target(New)
#avFrameworkManager.avSwitch Caller(#COM_OWNER) Toobjectnamed(VLFONE_DEMONSTRATION) Execute('*EXIT')
solves my issue.
Thanks,
David