Need to determine if ELMAH is logging an unhandled exception or one raised by ErrorSignal.Raise()
Posted
by Ronnie Overby
on Stack Overflow
See other posts from Stack Overflow
or by Ronnie Overby
Published on 2010-05-25T14:06:53Z
Indexed on
2010/05/25
15:51 UTC
Read the original article
Hit count: 334
I am using the Elmah Logged event in my Global.asax file to transfer users to a feedback form when an unhandled exception occurs.
Sometimes I log other handled exceptions. For example:
ErrorSignal.FromCurrentContext().Raise(new System.ApplicationException("Program code not found: " + Student.MostRecentApplication.ProgramCode));
// more code that should execute after logging this exception
The problem I am having is that the Logged event gets fired for both unhandled and these handled, raised exceptions. Is there a way to determine, in the Logged event handler, whether the exception was raised via ErrorSignal class or was simply unhandled? Are there other Elmah events that I can take advantage of?
© Stack Overflow or respective owner