Await to open new forms, issues

Dear Sirs,

Delphi 10.4. Sydney, update 2
TMS Web Core 1.8.3.0
https://www.tmssoftware.com/site/videos.asp?v=216
Example project:
WebCoreAwait.zip (35.5 KB)

Scenario:
When we click button "Login ..." the form is displayed. The event WebFormDOMContentLoaded is triggered where we raise random exception. The await funcionality stops the application flow from proceding to next statement and does not capture the exception. This is a problem because the execution has stopped (via exception) and should end the await.

Issue:
In video tutorial exception handler was not implemented. We can not reproduce a working scenario where exception would force "await" funcionality to continue to next statement or to trigger try except block exception handler. How can we control await funcionality? Make it continue, stop the code flow or to trigger overlaying exception handler.

Note:
If this can not be controlled it can produce more problems than benefits. For example executing async calls (httprequests) inside await will not be captured as they are non-blocking.

Kind Regards

We will consult with the pas2js team as this is a compiler and possibly JavaScript language related issue.
For now, I recommend to add exception handlers in your login form. When the exception is caught (and you can decide then at application level what to do with it), the await() flow will not be broken.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.