How to use multiple Business Rule Exception

Hey guys,

Would be super nice if you could help me.
So i want to automate a process.
There are multiple errors that could occur and they all need different handling.
However, I dont know how to add different exceptions to the catch block.
It seems like it is only possible to add one BusinessRuleException.

Do you know how i can add multiple Exceptions of the same type in the catch block?

Thank you very much!

Hi @Jarvis1

Can u elaborate ur use case

Throw all your exceptions as Business Exceptions, in Catch block use different “IF” conditions to differentiate with the keyword you are throwing.

thank you! Could you explain that in more detail please?
This is how I throw the exception:

What do I need to write in the if statement now?

Also could you explain to me what this field marked in red is for?

Thank you very much!

First of all check the screenshot below, you can use if conditions like this

Also the one you market Red: this is used to catch exceptions coming from Try block, you can simply put here exception, now this is your exception variable, you can use this variable to find out so many things like:

1 Like

ah! That makes sense now! Thank you very much!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.