Quantcast
Channel: UiPath Community Forum - Topics tagged error
Viewing all articles
Browse latest Browse all 4384

Catch BusinessRuleException in Try Catch avoiding the Global Handler?

$
0
0

@OKlink wrote:

Hi,
I have a complex project and so far I am using the Global Handler to handle technical exceptions throughout the project. My Global Handler is pretty much like the original version except it sends a mail with an included sceenshot to the developer team.

Now I want to improve the project to handle BusinessRuleExceptions. For this I thought I could throw a BusinessRuleException using the THROW activity and catching it in a TRY CATCH block.
I thought exceptions were only passed to the Global Handler if the exceptions were not caught before or if they were rethrown. But it seems this is only working, when there is a single activity in the TRY block. When I have more activities, the exception ist passed to the Global Handler first and then carried on to the CATCH block.

But how can I have a single activity in the TRY block? Do I have to build a TRY CATCH block with only the THROW activity in the TRY block? Really? Doesn’t sound like good programming.
Or is there a way to change the behaviour to first check if there is a CATCH block and only pass the exception to the GLOABL HANDLER if needed?
Or can I build something like a CATCH block in the Global Handler to handle my BusinessRoleException different than technical exceptions?

Thanks for any ideas!
Oliver

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>