Ashok98
#1
Hello All,
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
Hello @Ashok98
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.
Thanks
varunk
(Varun Kumar)
#4
@Ashok98
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
Thanks
Varun
Ashok98
#5
This is the error I throw
Ashok98
#6
I have declared system.exception only
Anil_G
(Anil G)
#7
Hi @Ashok98
Can you confirm if this how your try catch looks?

catch

IS the runtime error showing the same message you used in throw activity?
cheers
Hello @Ashok98
Tried the same flow and its working for me. Please run in debug mode and see how the flow is happening.

Thanks
varunk
(Varun Kumar)
#9
@Rahul_Unnikrishnan
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
Thanks
Varun
Ashok98
#10
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