Author: ewgoforth | Posted on: 5/7/2009 7:38:43 PM | Views : 235

Hello,
I have a pretty general .NET exception handling question, it's not necessarily specific to ASP.NET.  In my application I'm doing something like:

Public Function function1() as integer
try
dim myvar as integer
myvar=function2

catch
'do some logging
throw ex
end try
end function

 
Public Function function2() as integer
try
'Something here cause an error

catch
'do some logging
throw ex
end try
end function


So I'd like to log the error only once, when it first occurs and then throw it up the exception stack until it gets to the top level where the exception or some more user-friendly error is displayed to the user.  But how do I log it only once?  How do I know it hasn't been logged before? 
http://www.codeproject.com/KB/architecture/exceptionbestpractices.aspx talks ...

Go to the complete details ...