Posted on 2006-11-05
Is there a way I can make my try/catches conditional? What I want to do is turn them all off globally, because in the development environment it is easier to let the debugger catch the exceptions (because then I can watch vars, etc), rather than my catch code process it. But I don't want to comment out a million try/catches to do this. Ideally I'd like something like:
Const TRY_CATCH_ENABLED as Boolean = True
If TRY_CATCH_ENABLED Then Try
If TRY_CATCH_ENABLED Then Catch ex as Exception
If TRY_CATCH_ENABLED Then End Try
Then I could turn off all my exception handling globally. Obviously the above isn't even close to correct, but it gives you the idea of what I want to do. Any suggestions?
(I know this is possible with On Error statements, but hopefully I don't have to revert back to those.)