Page 1 of 1

Using Madexcept in Server software

Posted: Fri May 14, 2004 12:45 am
by Oliver
I have peppered MadExcept throughout my program to handle various types of exception and email me the results. When I use a datamodule, it is sometimes in an application that used by a user, and sometimes in a server. The application reports the error to the user, but the server emails me and continues. When I debug either, it also emails me.

I'd like to be able to use the madexcept settings to email me when something happens in the server, or to log to something like the Event Viewer in NT/2000, or just a log file, but not just exceptions, good things as well.

I'd also like to have different madexcept settings when I am debugging. I'd like to be able to turn on or off some exceptions when debugging, not just permanently, but after I have seen them once. For instance I get a lot of OLE Errors, which I ignore. But if I turn off integrated debugging, I don't see other exceptions. I'd also like the emails not to occur while I am debugging, as this sometimes takes a brief while, especially when I am off site and running on a slow link. So I'd like a different set of options when debugging in Delphi from running not in Delphi.

Oliver Townshend

Posted: Fri May 14, 2004 9:43 am
by madshi
Hi Oliver,

you can configure most options at runtime. E.g. the following code disabled auto mailing if your program runs inside of a debugger:

uses madExcept;

initialization
// put this into one of your units
if IsDebuggerPresent then
AutoMail := false;
end.

About ignoring some exceptions inside of the debugger: Check out the FAQ #1 (in the documentation). That should help telling madExcept to ignore some specific exceptions under specific circumstances. You need to do the ignore logic yourself, though (e.g. counting exceptions and only show them the first time or things like that).

Does that help?

Using Madexcept in Server software

Posted: Sun May 16, 2004 11:10 pm
by Oliver
Thanks, I'll give these things a try.

Oliver