11
Views
1
Comments
Solved
Multiple Roles, Which Exception Should I Choose?
Application Type
Reactive
Service Studio Version
11.10.4 (Build 36717)
Platform Version
11.7.2 (Build 5749)

Hello! I'm new at Outsystems, and I've stepped on a problem.

I have a Server Action (in a Core Module) in which I Check the User's Role. This Action can be performed by multiple roles. If the User has no Valid Role, it raises an Exception.


When Handling the Exception in the other Module, I need to select which Exception is going to be handled. 

User Exceptions created on the Core Module, are not "imported" via Dependencies to the Main Module.

How do I do this? Which Exception should I choose, as it looks like the UserExceptions are "Module-Only?" Or what is the Best Practice?

Screenshot20201231at02.26.00.png

Rank: #94
Solution

Hello Pedro,

Hope you're doing well.

Unfortunately, it is not possible to import Exceptions between modules.

What you can do in this scenario is to add an Output Parameter to your NewRequestCreate Server Action and assign a different value to it according to the Exception that was thrown.


As an example of what I'm referring:

Back to your Reactive module, you can evaluate this defined Output Parameter and handle it accordingly.


Hope that this helps you!


Kind regards,

Rui Barradas