Use try-catch and throw

@jadbenn Can you use a Message Box in Excel Scope and Check if it goes to that part of parallel Activity

Yes it does, because it opens the excel file, otherwise I won’t get the excel error.

It’s not the first time I use this structure, and it worked fine in other projects.
So I also tried inverting the Element exist activity, so I put blnExist = False in the if statement before the throw to see if it works, and Yes, the throw activity worked perfectly. So I don’t understand why it gets stuck before the throw when it’s True

@jadbenn At what part did you think it’s getting Stuck? :sweat_smile:

I think it’s getting stuck in the throw, it’s not executing the throw, and I don’t see why. Throw is Faulting…

@jadbenn Can you check How long will it take to continue the process? or Can you Wait for another error to be popped up when it’s still Stuck :sweat_smile:

It has been 5 minutes and still nothing happened. I let you know in a few minutes is something happens…

@jadbenn No i guess there’s some problem :sweat_smile: 5 minutes is too long

I agree…

@jadbenn Oh Yes, I forgot to ask what is the value for throw Activity?

new Exception(“Error Thrown”)

@jadbenn That’s fine, It won’t effect the process :sweat_smile:

As I said previously, the throw works fine when I invert the if statement, it is linked with the catch correctly. But in the “if” statement I want to use, It’s not working. A bit confusing… :neutral_face:

@jadbenn What do you have in Catch block?

This is another project in which I’m doing the exact same thing, and it works fine…


Here’s my catch. But it doesn’t reach the catch, so the problem is still in the try

you can try one more thing, extract each side inside the parallel activity to its own workflow file and run them again.

1 Like

I tried what you said but it still didn’t work, but after that I tried extracting the whole Try (whole process), and it worked! I have no idea how or why, I guess the throw works in my case only when it’s invoked from another workflow… :unamused:
Nevermind, thank you so much @bcorrea and @supermanPunch for your help!

Cheers

2 Likes

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