PDA

View Full Version : Ability to detect "Handled" exceptions


MikeM
27-Nov-2009, 04:29 PM
Hello,

I know that there is a HandledExceptionNotify event that gets fired when a handled exception occurs, but is there any way to detect that an exception is a "handled" exception in the ExceptionActionNotify and ExceptionNotify Events?

We would like to log the handled exceptions (or at least particular types), but we would never want to display a dialog for the handled exception.

Thanks,
Mike

Alex
30-Nov-2009, 07:06 AM
Hi,

I think that you need to use exception filters. Add new filter, enter class name, specify "EurekaLog" handler, select "Handled" type and switch dialog to "none".

You can create empty VCL application with test code to check, how this'll work, and if it'll be suitable for you.

MikeM
30-Nov-2009, 04:51 PM
Hi,

Is there any way to specify that ALL handled exceptions will not show a dialog? Otherwise, we have to add an exception filter for all the different possible types of exceptions that could be handled. We may not even know all the exception types because some could come from a third party library.

Typically we want to disable dialogs and logging for all handled exceptions, but there are a few special exception types that we want to log and not show a dialog.

Thanks,
Mike

Alex
01-Dec-2009, 07:52 AM
Hi,

Yep, you can.

Just put ExceptionNotify and HandledExceptionNotify event handlers in your application.

In ExceptionNotify's handler - turn dialog on, in HandledExceptionNotify's - turn dialog off.

See also: http://blog.eurekalog.com/tips-tricks-part-1/

MikeM
01-Dec-2009, 07:56 PM
Hi Alex,

Thank you for the reply. That helps.

Mike

Alex
02-Dec-2009, 07:58 AM
Hi,

No problem ;)