E
Eric Sabine
I built a generic exception handler form which allows the user to get
information from it, print it, email it, etc. for exceptions for which I
explicitly didn't handle in code, such as missing permissions on a stored
procedure, etc. I use this exception handler in all of my applications and
it can be called as simply as follows
try
...
catch ex as sqlexception
ExceptionHandler(ex, otherData1, otherData2)
catch ex as exception
ExceptionHandler(ex, otherData1, otherData2)
end try
As a habit, I tend to wrap every method and event within a try-catch block,
but now I am wondering if that is necessary. All of my apps start with Sub
Main which also contains a try-catch block that catches these 2 exceptions.
So if there isn't a specific exception within a method or event that I am
specifically testing for, or where I do something different that I've
already specified in Sub Main(), is it just a waste to catch an exception
there that I, by default, could already catch in Sub Main()?
Hope this makes sense.
Eric
information from it, print it, email it, etc. for exceptions for which I
explicitly didn't handle in code, such as missing permissions on a stored
procedure, etc. I use this exception handler in all of my applications and
it can be called as simply as follows
try
...
catch ex as sqlexception
ExceptionHandler(ex, otherData1, otherData2)
catch ex as exception
ExceptionHandler(ex, otherData1, otherData2)
end try
As a habit, I tend to wrap every method and event within a try-catch block,
but now I am wondering if that is necessary. All of my apps start with Sub
Main which also contains a try-catch block that catches these 2 exceptions.
So if there isn't a specific exception within a method or event that I am
specifically testing for, or where I do something different that I've
already specified in Sub Main(), is it just a waste to catch an exception
there that I, by default, could already catch in Sub Main()?
Hope this makes sense.
Eric