Try Catch not catching error

Hi all, I have been using Try Catch multiple times but this time something is not right. In the try block I have List all videos of a Playlist and sometimes this activity can fail because channel has no playlists. And I want to just continue execution when the error comes. However, even with this set up I still get errors and workflow stops.


Error I get:

I don’t get why the error is not ignored. Will appreciate any help!
Thanks,
Veronika

Hi,

It seems Global Exception Handler catches exception before TryCatch does.
So, Can you try to remove GlobalHandler if you use Studio?

If you use StudioX, it may have to edit project.json using text editor.

Regards,

1 Like

Hi, thank you so much for your answer. I am using Studio X, should I just remove GlobalHandlerX.xaml from the project.json?


So after removing it will be “exceptionHandlerWorkflow”: “”?
Thanks!

HI,

Can you try to remove whole the key value pair of GlobalHandler as the following?

Please note that it’s unofficial way. If you can use Studio, it’s better to remove handler in Studio feature.
And also please backup the file before editing.

Regards,

Hi, thank you so much for your solution, it works. Now I am just curious how the script will send error if something unexpected happens. Will it fail? is it better now to put the whole script in the try catch because I dont have globalhandler?

Yes. It throws exception as Runtime error, as the following image.

is it better now to put the whole script in the try catch because I dont have globalhandler?

I think it’s no problem if enclosing the entire sequence. However, it’s also good to enclose each sequence which may cause error.

Regards,

Thank you very much, I really appreciate your help!

1 Like

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