In my Reactive module there are some web blocks in a UI Flow. If an exception occurs in one of these web blocks, the exception handlers in the OnException of the UI Flow are ignored. The exception is handled by the global exception handler. Why is the exception handler on the UI Flow level ignored?
Hello Rogier,
i think the onexception of a ui flow, only covers screens in that flow, not webblocks. in other words, the bubbling up of exceptions in search of a willing handler goes something like
Action where is thrown > call chain of all above actions > On Exception of the UI flow of the screen > On Exception defined as global for the module
The webblocks themselves don't come into it, i think.
I experimented a bit with both traditional and reactive, and see same behaviour in both.
See attached omls
I am also suspecting that what you say "the onexception of a ui flow, only covers screens in that flow, not webblocks", is true! Can somebody conform this?
I cannot find this in the documentation.
Thanks voor your comments!
Hi Rogier,
Have you tried to remove the global Exception?
as the image below:
Kind regards.
Thanks for your response. Yes, but that makes no difference. The exception is handled by the handler that is valid for the Screen in which the web block is present, in a different module.
Hi @Rogier Olde Dubbelink
What you need is to have the global exception as public as we have in traditional web apps, but there are no public exception handlers in Reactive Web Apps. You need to replicate them in all your application Modules.
You can check it here: https://success.outsystems.com/Support/Enterprise_Customers/Upgrading/Introduction_to_migrating_Traditional_Web_to_Reactive_Web_Apps/Traditional_to_Reactive_App_migration_reference/Front-end_migration_introduction/UI_flow_elements
Regards
Gonçalo Almeida
Hi Gonçalo , thanks for you reply but I cannot see why this would explain why the local UI-flow is ignored. It should bubble to this one first.
Hello @Rogier Olde Dubbelink,
What is/are the type of error(s) being reported in Service Center when this occurs? It may hold a clue to this unexpected behavior.
Regards,
AJ
Hi AJ, I am not sure if have explained the situation well, I am sorry.
I just want to have any exception to be handled by the UI-flow exception handler, for instance a role check exception. So my question is: why is the exception handler of the UI-flow, containing the web block, ignored?
Thanks.
I just concluded a little demo of my own and observed the following:
1. Works as expected - If the UI Flow OnException has a handler for 'All Exceptions' then the UI Flow does handle all the errors raised in a block.
2. Works as expected - If the UI Flow OnException has a handler for the specific error raised in the block then too the UI Flow does handle the error. E.g. if the block raises a 'User Exception_1' error and the UI flow's OnException has a handler for 'User Exception_1' error then it gets handled by the UI Flow OnException.
3. Unexpected behavior(?) - If the block raises an exception 'User Exception 1' (child) but the UI Flow OnException has a handler for the 'User Exception' (parent) then the UI FLow was skipped and handled by the Global Exception handle (assuming we do not remove it as the Module's Global Exception Handler).
In a nutshell, are you encountering said issue because of one of the above? Item #3 above is 'unexpected' I believe because of the information here https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Handle_Exceptions
Hope this helps in some way,
Best regards,
Hi AJ,
are you sure that the block raising the exception and the screen where the block is in, are not in the same UI Flow ??
I had a try, and the behaviour I saw, was that it is the OnException of the screen's UI Flow being hit (if it exists), not the one of the webblock.
Can you share an oml on how you got it to work ?
Dorine
Hello Dorine,
First of all thank you, for saving me some head scratching here! You are correct and then some. My block and screen are in the same UI Flow. When I separated the two I get the same results as you.
Now I notice that the OP's screenshot did not have any screens in the UI Flow (just blocks). Coincidentally, yesterday, I was unable to open the oml's you had shared. I was downloading files named 'Download' with no extensions and unable to open them. I am able to open them today though.
and for reactive