Try catch is not catching the indended exception

I am using try catch in my workflow. In try block I am trying to convert a string to integer and trying to catch the exception by using system.exception but the exception is not caught. can anybody help. I have attached the screenshots

@kishan_santlani

You can’t handle this with system.exception, you have to give specific exception type to handle this

as below you have to search for InvalidCastException

Mark as Solution if this helps

Thanks

1 Like

Thanks for your reply @ksrinu070184 but I am still getting the same error after using InvalidCastException. To give you more insight of the problem I am using Try Catch Activity in Flocwchart Instead of Sequence. Does this affect?

@kishan_santlani

can you run the file not Debug file and share the exception screenshot

Thanks

1 Like

Thank you so much @ksrinu070184 for the help. It worked fine while running the file instead of debugging. It seems like try catch do not work as expected in debug mode.

@kishan_santlani

Happy Automation, Happy Learning

Mark as solution if it works for you

Thanks

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