Toad World® Forums

Exception handling in automation workflows

Using TDP 5.1.2.166 (32 bit) version. Is there an Exception Handling activity that one can use to catch and handle exceptions in workflows? I saw a "Throw Error" activity but nothing like a catch exception. I'd like to be able to catch specific exceptions especially when running SQL queries (but not limited to this). While this is a generic question, in my specific case I'd like to be able to handle a "Table not found" exception when I run a "drop" table command. Any help would be appreciated!

No Catch task that I know of in our Automation toolbox, but might be a great enhancement suggestion. Encourage you to do a quick write-up in our Idea Pond.

As a workaround, you could possibly use an IF-THEN construct to check for Table Not Found conditions. Not as elegant as Catch, but might work for what you need...

Thanks Gary. Unfortunately, the if-then construct won't work as I have multiple creations of temporary tables within each report and the "drop" command is overused to make sure that those tables get deleted. Inadvertently, there are instances where we do a "drop" on a table which has already been deleted and therefore we get an exception which shouldn't abort the execution of my workflow. This is just an instance but one can think of many other scenarios (SQL or not-SQL related) where exception handling would be a must for an automation workflow.

I will submit this as an enhancement suggestion although my previous submission (allow for variables in the file path) got no movement :frowning: .

Do you guys have any arrangements for on open-source like setup where folks in your Toad community can submit improvements to your code base? Do you have an API which we could use to create activities/constructs/frameworks/etc?

I figured that IF-THEN may not work in your case, but mentioned it just in case...

Thanks for submitting your idea, and yes, it's not guaranteed that every idea submitted gets priority.

Unfortunately, our code base is not open source. It would be nice to have a public repository of code or automation script logic that folks could share with each other and download. Product Management/Dev Team take note.