Reframework - system error thrown although I am setting a businessruleexception

Hi fellows,

So I am having this issue with my workflow in ReFramework:

My init module is extracting some emails and their information from outlook, then depending on if the mail is correct through a RegEx, it will be sent to one folder “Done” or another “Rejected”.
Now I just found an email without headers (which should not happen), as the error is thrown inside the try catch (the subject still gets extracted), that is inside the loop, my understanding is that it should handle it (businessRule Exception that sends an email to the developer) and continue to the next item.

However, whenever it reaches this one email without the headers it throws a SystemError and the bot finishes the process.

Could someone please help me? Or indicate me how I should handle unknown issues such as this, so the bot does not stop?

Thanks a lot!

Cheers,
Mogambo

@Mogambo

If you want to throw BusinessRule Exception then use Throw activity and mention below in it.

         new BusinessRuleException("Exception Message")

And then it will go to corresponding Catch block. I.e. BusinessRuleException block.

@lakshman Thanks for your answer, but where should I throw the exception, if I do not know which activity is going to fail, can you give me an example?

1 Like

@Mogambo

If you know where the exception will occur exactly then use Throw activity to throw BusinessRuleException.

If any unknown Exception occurs then it throw system Exception but not BusinessRuleException. For this add System.Exception under Catch block to catch unknown Exception.