Since I am already using ELMAH as a storage mechanism for my unhandled
exceptions, is there a way to tap into it and use it to store some of
my "handled" exceptions that I care about keeping track of?
I've looked at creating my own instances of the ErrorLog and other
objects, but didn't see anything that let me use it that way.
Thanks,
Adam
-or-
http://groups.google.com/group/elmah/browse_frm/thread/5c75b93558bfdac6
- Atif
ELMAH normally works by allowing the exception to bubble up to the
application level and working from there. At that point, however, it
will be impossible (or at least more difficult) to keep the user on the
same page.
Another thing that I should mention is that if you are expecting for
some exceptions to happen, then it's a lot more efficient for your app
to manage these possibilities before the actual exception happens. I
don't know exactly what exceptions you are swallowing, but for example,
let's say for example you were iterating through a recordset and
calculating some percentages. You'd be better off checking if the
denominator == 0 and writing a message than waiting to catch a
DivisionByZeroException and then writing the error message. It is still
possible to log an exception in ELMAH without being in a catch block.
-Scott
In my case, I am trying to handle things like timeouts (trying to talk
to AD, connect to sql server, or long running sql operations) that I
have to handle in Page_Error, log the exception so the dbas and help
desk folks can start troubleshooting what may be happening, and send
the user to an "Application is temporarily unavailable"-type page.
Adam