Root > Integral parts > Options > Advanced page > Exceptions filters page

Exceptions filters page

Previous pageReturn to chapter overviewNext page   

This is "Advanced/Exception filters" page in EurekaLog project's options.



Exception filters options


This page allows you to set up exception filters. Exception filter is a filter which can alter EurekaLog's behavior based on some properties of exception. It is a easy way to customize EurekaLog on per-exception basis without writing code.


Important note: you can not use exception filters to alter behavior for leaks (e.g. EMemoryLeak/EResourceLeak), because exception filters are already finalized when leaks checking is running.



1. "Activate Exceptions Filters" (.ActivateFilters) option enables or disables exception filters globally. Exceptions filter below will have no effect when this option is disabled.



2. "Exception Filters" (.ExceptionsFilters) option defines one or more exception filter.


Usually exceptions are identified by exception's class name. You can also identify exception by source location. And you can identify exception by its type (handled or unhandled). Once exception is identified - you can change handler for it (none, RTL or EurekaLog), dialog class (to any of existing dialog classes), override error message or set action (restart or terminate). Exception filters are applied before processing exception. Filters are applied in order from top to bottom. First matched filter is applied.



[I] in exception class name means that filter will check the inner exception instead of default outer exception. This has no effect if there are no nested exceptions (which is a typical case);
+ in exception class name means that filter will also check for all child classes of the specified class name. Otherwise strict match will be used (e.g. the class only, no child classes);
= in exception message means that exception's message must match the specified value exactly;
% in exception message means that exception's message must contain the specified value.


When exceptions filters are not enough - you have to write code (event handlers).


Click on "Add" button to add new filter.
Select existing filter and click on "Remove" button to delete selected filter.
You can double-click on existing filter to edit (modify) selected filter.
You can use "Move up"/"Move down" buttons, Ctrl + Up/Ctrl + Down or simple mouse dragging to re-order filters.


Note: sometimes it's more easier to use custom attributes instead of exception filters.


Important note: ensure that features specified in exception filters will be available at run-time. For example, if your application uses MS Classic-styled exception dialog by default and you want to switch to EurekaLog-styled dialog for some exceptions by using exception filters - then be sure to include code for EurekaLog dialog into your application.



See also:

Send feedback... Build date: 2023-09-11
Last edited: 2023-03-07
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.

Permanent link to this article: