14
Views
10
Comments
How to Handle Core widget exception in the End User application as User exception

Hello 

- My requirement is that in the core widget(CW) ,I raise user exception (session Expired ) and in the main module     (end user module). I want to handle that exception, but the aim to handle that exception is in the user Exception handler not in the all Exception handler.
- For that, I create two application one for core widget and one for main module.
- In Core widget there is one Web Block and inside that button, On click action will Raise exception (session expired ) as Show in fig.

- In main module, there is global exception, In that I create one new handler (user exception handler ).so, I Want  that raise exception( CW module Exception ) is handle by user exception handler which is in the main module.right now it is handle by all exception handler. So, it is possible to handle that exception by user exception? For reference i m attaching the fig .

note: I remove the on Exception handler which is in the CW module.So only end user is handling the exception which is raised in the CW/Core widget

 


mvp_badge
MVP
Rank: #19

Hi Akshay Deshpande,

If SessionExpired is defined by you under UserException on your _CW module, then you will be able to catch it with a handler for UserException on the main module.

What you will NOT be able to do is to handle a SessionExpired exception directly in the main module... it will be seen as a generic UserException, so like Daniël mentions you would need to add something to the Exception Message property that would allow you to check its value in order to distinguish a SessionExpired exception from other UserExceptions.

Hope this helps!


Rank: #1031

Hey Jorge Martins

 yes,i m doing the same as you said ,If Session Expired is defined by you under User Exception on your _CW module, then you will be able to catch it with a handler for User Exception on the main module.

But, It is not possible, the all exception handler (In the main module) handle that exception which is raise in the CW

mvp_badge
MVP
Rank: #19

I just noticed you are in a Reactive Web application. The behavior I described is correct from my past experience with Traditional Web Applications... there may be something different going on in that case.

Rank: #1031

Okay. yes, I m Reactive web app. I got it what you said, let check any other reply . Because ,this is not match to my requirement and thank you for your quick response. 

mvp_badge
MVP
Rank: #17

Hi Akshay,

The consumer module can handle underlying exceptions, but how it is handled by OutSystems seems to be different between RWA and TWA. Jorge's comment is correct for TWA. For RWA it seems that producer module User Exceptions are handled by the All Exception handler. Why I don't know, I will ask around.

Regards,

Daniel

Rank: #1031

Okay. if you will got any solution,let me know.

mvp_badge
MVP
Rank: #17

Hi, I got feedback from OutSystems, this is potentially a bug of the exception handling in RWA.

OutSystems ask me to ask you to submit feedback, from with Service Studio, and describe the problem (you can copy/past the link of this discussion). By giving the feedback this way your feedback goes straight to the backlog of the product team to be prioritized and analyzed.

Additionally, you can also create a support case.


Rank: #1031

Hello Daniel,

thank you for your Response, I will give feedback.


Rank: #127

Hi all,

see this post

I did some tests last year in both traditional and reactive regarding passing exceptions from producer to consumer, and one of the findings was that indeed in RWA user exceptions get handled by AllExceptions in the consumer.  My tests were with producer server actions getting called, but as your example shows, it also holds up for webblocks.

See also this post, where Mariano Pico talked about filing a bug report, maybe worth checking with him what the result was of that.

Dorine

Rank: #1031

Hello Dorine,

 Okay,got it. Thank you for your response.