Log an error without having to throw it

27 views
Skip to first unread message

dege

unread,
Apr 17, 2007, 5:15:52 PM4/17/07
to ELMAH
I'd like to log and email an exception but then handle the exception
in my code. For instance:

try {
thisMethodCausesAnException();
} catch (Exception ex) {
labelError.Text = "An exception occured.";
GotDotNet.Elmah.LogException(ex);
}
// Continue processing...

Is there a method in Elmah that will allow me to do this? Or do I need
to throw the exception have the HttpModule pick it up to log it?

dege

unread,
Apr 17, 2007, 5:18:28 PM4/17/07
to ELMAH
Oops, looks like someone else already asked the same question:
http://groups.google.com/group/elmah/browse_thread/thread/39ff7c6fb86e4fda

Sorry, first time google groups user... I didn't notice there were
other discussions until after I posted and it brought me to a list of
all the discussions.

dege

unread,
Apr 17, 2007, 5:20:53 PM4/17/07
to ELMAH
This seems to come up frequently. Might I recommend added an example
of this to the sample solution?

On Apr 17, 3:18 pm, dege <dgarcia...@gmail.com> wrote:
> Oops, looks like someone else already asked the same question:http://groups.google.com/group/elmah/browse_thread/thread/39ff7c6fb86...

Atif Aziz

unread,
Apr 18, 2007, 2:04:35 AM4/18/07
to el...@googlegroups.com
Noted!

- Atif

Reply all
Reply to author
Forward
0 new messages