I have a try catch block. In try block I want to throw an exception when a logic breaks. So I used throw activity for throwing error.
In catch block, I have catched the exception by using system.exception.
But when I run the solution. Run time error is shown but it is not going to catch block.
Please provide solution for this
@Ashok98 please give us error screenshot
You need to declare the catch based on the exception that you are getting. Can you share the exception that you are getting.
and if possible the Try catch activity that you have created.
In try catch use thrown activity for custom exception message it will throw the message then after it won’t go to catch block, Check your flow again
This is the error I throw
I have declared system.exception only
Can you confirm if this how your try catch looks?
IS the runtime error showing the same message you used in throw activity?
Tried the same flow and its working for me. Please run in debug mode and see how the flow is happening.
The above image which you shared that is correct, As You given the customized message it is populated
Let me know if you any query
The problem was I had the try catch inside a workflow so it was catching. The I surrounded the workflow with try catch , then exception got caught